Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: lock bun to 1.1.12 for unexpected peer deps #170

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.1.12
Comment on lines 11 to +13
Copy link

@coderabbitai coderabbitai bot Feb 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

锁定 bun 版本以解决依赖问题

这个修改通过锁定 bun 版本来解决构建过程中的依赖问题,是一个合理的临时解决方案。

让我们验证一下指定版本的有效性和相关问题的状态:


🌐 Web query:

What is the latest version of bun? Is version 1.1.12 available?

💡 Result:

The latest version of Bun as of February 2025 is v1.2.2, released on February 2nd[8]. This version includes improvements like text-based lockfiles (bun.lock)[6][7], enhanced S3/Postgres APIs[7], and better Node.js compatibility[7].

Regarding version 1.1.12 - there's no mention of this specific version in official sources[4][8]. The available releases show:

  • Current stable: v1.2.x series (latest v1.2.2)[4][8]
  • Previous minor: v1.1.x series (latest v1.1.45)[4]

The version numbering skips from v1.0 directly to v1.0.x patches before jumping to v1.x increments[4], suggesting v1.1 might have been an internal development branch rather than a public release series[5][7]. For production use, you should target v1.x releases like v1.x.y where x ≥ 2[7][8].

To install the latest version:

curl -fsSL https://bun.sh/install | bash
# or via npm
npm install -g bun@latest

Citations:


🌐 Web query:

What is the current status of bun issue #8406 regarding peer dependencies?

💡 Result:

As of February 2025, Bun issue #8406 remains an open problem affecting peer dependency handling in specific scenarios[10]. The core problem manifests when:

  • Using Bun v1.0.23 or newer
  • Projects contain dependencies with strict peer version requirements
  • Installation fails despite seemingly compatible versions being available

Example failure case:

error: [email protected] has unmet peer dependency "react@^18.2.0"

Even when [email protected] exists in dependencies[10].

This contrasts with Bun's typical behavior where:

  • Peer dependency conflicts aren't detected during installation[2]
  • Runtime errors may surface instead of build-time warnings[2][9]

Key technical details:

  • Appears related to Bun's dependency resolution algorithm changes in v1.0.23
  • Affects projects using framework combinations like Next.js + Framer Motion[10]
  • No official fix has been documented in available sources as of current date

Developers encountering this can:

  1. Temporarily pin Bun to pre-1.0.23 versions
  2. Use bun install --force as workaround
  3. Monitor GitHub issue #8406 for updates[10]

This highlights an ongoing challenge in Bun's implementation of npm-style peer dependency resolution compared to Node.js-based tools[2][9].

Citations:


注意:锁定的 bun 版本 1.1.12 在官方记录中不存在

经过验证,目前官方提供的 bun 版本中:

  • 最新稳定版是 v1.2.2
  • 在 v1.1 系列中,最新的是 v1.1.45

同时,关于 bun issue #8406 的问题仍未解决,涉及 1.0.23 及更新版本在处理 peer dependencies 时出现问题。
建议检查是否有意使用自定义或预发布版本 1.1.12 作为临时 workaround。如果没有明确理由使用该版本,推荐更换为官方发布的稳定版本(如 v1.1.45 或 v1.2.2),以避免潜在的不可预料问题。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

@afc163 抱歉之前的分析有误。您说得对,bun 1.1.12 确实存在于 npm registry 中。感谢您的指正!


🏁 Script executed:

#!/bin/bash
# Verify the package information
npm view [email protected] version

Length of output: 36



✏️ Learnings added
Learnt from: afc163
PR: react-component/rc-test#170
File: .github/workflows/test.yml:11-13
Timestamp: 2025-02-11T09:10:31.123Z
Learning: When verifying package versions, always check both the official releases and the npm registry, as some versions might be available on npm but not prominently featured in release notes or documentation.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!

- run: bun i
- run: bun run lint
- run: bunx tsc --noEmit
Expand Down