-
Notifications
You must be signed in to change notification settings - Fork 6
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
Conversation
Walkthrough这个 PR 更新了 GitHub Actions 的工作流程配置,在设置 Bun 的步骤中添加了参数 Changes
Sequence Diagram(s)sequenceDiagram
participant W as Workflow
participant S as Bun Setup Action
participant N as 后续步骤
W->>S: 触发设置Bun (bun-version: 1.1.12)
S-->>W: 安装指定版本Bun
W->>N: 执行后续任务(检出、安装、测试等)
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/test.yml
(1 hunks)
🔇 Additional comments (1)
.github/workflows/test.yml (1)
14-18
: 确认 bun 命令的兼容性请确保所有使用 bun 的命令(
bun i
、bun run lint
、bunx tsc
、bun run compile
、bun run test
)在 1.1.12 版本下都能正常工作。
- uses: oven-sh/setup-bun@v2 | ||
with: | ||
bun-version: 1.1.12 |
There was a problem hiding this comment.
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:
- 1: https://community.bunpro.jp/t/ios-app-official-release/117658
- 2: https://www.youtube.com/watch?v=yXTFOeGly9o
- 3: https://bun.sh/docs/installation
- 4: https://github.com/oven-sh/bun/releases
- 5: https://bun.sh/blog/bun-v1.1
- 6: https://answers.netlify.com/t/support-new-bun-lock-text-lockfile-for-bun/134716
- 7: https://bun.sh/blog/bun-v1.2
- 8: https://www.npmjs.com/package/bun?activeTab=versions
- 9: https://www.npmjs.com/package/bun-types?activeTab=versions
- 10: https://www.youtube.com/watch?v=rtj-zd93Vfs
🌐 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: react-dom@18.2.0 has unmet peer dependency "react@^18.2.0"
Even when react@18.2.0
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:
- Temporarily pin Bun to pre-1.0.23 versions
- Use
bun install --force
as workaround - 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:
- 1: https://bun.sh/guides/install/add-peer
- 2: https://codingmall.com/knowledge-base/25-global/24052-how-does-bun-handle-dependency-resolution-differently-from-npm
- 3: https://dev.to/icy0307/peer-dependencies-in-depth-1o3b
- 4: https://bun.sh/guides/install/trusted
- 5: https://volt.build/news/2023/04/12/capacitor-and-npm-6.html
- 6: https://www.markey.senate.gov/imo/media/globalwarming/files/WEB/shadeggMaterials.pdf
- 7: https://bun.sh/docs/install/overrides
- 8: https://archive.org/stream/TheOakLeafVol431981January16December18/The%20Oak%20Leaf%20(Vol%2043,%201981%20January%2016-December%2018)_djvu.txt
- 9: support peer dependencies oven-sh/bun#3259
- 10: Bun@1.0.23+ install violates peer dependency constraints oven-sh/bun#8406
注意:锁定的 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),以避免潜在的不可预料问题。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coderabbitai 1.1.12 是存在的,你看看 https://www.npmjs.com/package/bun/v/1.1.12
There was a problem hiding this comment.
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 bun@1.1.12 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!
锁定 bun 的版本为 1.1.12 以绕过非预期 peer dependencies 解析导致 father 构建失败的问题,等 bun 修复后再解除锁定:
现场链接:https://github.com/react-component/motion/actions/runs/13254919898/job/37000056389?pr=62
关联 father PR:umijs/father#804
关联 bun issue:oven-sh/bun#8406 (comment)
Summary by CodeRabbit