`cf migrate` fails with `ERR_PNPM_IGNORED_BUILDS` in a pnpm workspace that has not approved workerd
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- build-system, cli
Hướng nghiên cứu
Read the cf migrate install path in installProjectDependencies from @cloudflare/codemods, then compare it with the build approval handling added for cf init and @cloudflare/autoconfig. Reproduce with the provided pnpm workspace and check pnpm-workspace.yaml behavior for existing entries, explicit false decisions, and --dry-run. Done means migration approves required builds before installing, or skips installation with clear approval guidance, without leaving a throwing generated config.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary of the issue
In a pnpm workspace whose pnpm-workspace.yaml does not approve workerd's build script, cf migrate writes cloudflare.config.ts and then fails when it installs cf. pnpm 12 rejects the install because workerd, a dependency of cf, has an unapproved build script. cf migrate exits with code 1 and writes throw new Error("Migration incomplete. …") into the generated cloudflare.config.ts.
cf init handles this since #92 (fixed in #136), and cloudflare/workers-sdk#16035 (PR cloudflare/workers-sdk#16054) adds the same approvals to @cloudflare/autoconfig. cf migrate installs through installProjectDependencies in @cloudflare/codemods, which neither change covers. @cloudflare/codemods 0.7.3, the version on main, has no build-approval step either.
Expected behaviour
When cf migrate installs with pnpm, it approves the builds that cf needs (workerd) in the active pnpm-workspace.yaml before it installs, as cf init does. It keeps existing entries and explicit false decisions, and writes nothing on --dry-run. If cf migrate cannot approve the builds, it skips the install and says which builds to approve, instead of writing a config that throws.
Version of cf used
1.0.0-beta.27
System information and package versions
System:
OS: macOS 27.0
CPU: (14) arm64 Apple M4 Pro
Memory: 412.20 MB / 48.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 26.13.0 - ~/.local/share/fnm/node-versions/v26.13.0/installation/bin/node
npm: 11.20.0 - ~/.local/share/fnm/node-versions/v26.13.0/installation/bin/npm
pnpm: 12.16.1 - /opt/homebrew/bin/pnpm
bun: 1.4.4 - /opt/homebrew/bin/bun
Deno: 2.9.8 - /opt/homebrew/bin/deno
Watchman: 2026.10.26.00 - /opt/homebrew/bin/watchman
npmPackages:
cf: 1.0.0-beta.27 => 1.0.0-beta.27
Reproduction (optional)
- Create these files:
package.json:{ "name": "cf-migrate-pnpm-repro", "private": true }pnpm-workspace.yaml:packages: ["apps/*"](noallowBuilds)apps/worker/package.json:{ "name": "worker", "private": true, "type": "module" }apps/worker/wrangler.jsonc:{ "name": "worker", "main": "src/index.js", "compatibility_date": "2026-11-01" }apps/worker/src/index.js:export default { fetch() { return new Response("Hello"); } };
- Run
pnpm installat the root. - In
apps/worker, runpnpm dlx cf@latest migrate.
cf migrate exits with code 1. cloudflare.config.ts contains the throw, and pnpm-workspace.yaml is unchanged.
Workaround: approve workerd first (allowBuilds: { workerd: true } in pnpm-workspace.yaml), then cf migrate completes and writes no throw. Or run cf migrate --no-install and install cf yourself.
Relevant error logs (optional)
Using the Wrangler bundler because @cloudflare/vite-plugin is not declared. Pass --bundler vite to override.
Updated 3 file(s):
├─ cloudflare.config.ts
├─ package.json
└─ ../../pnpm-lock.yaml
Follow-up work:
└─ [required] The generated configuration was written, but `cf` could not be installed automatically. Install `cf@latest` with your package manager before using it. Installation failed: …
devDependencies:
+ cf 1.0.0-beta.27
Error: ERR_PNPM_IGNORED_BUILDS
× adding a new package
╰─▶ Ignored build scripts: [email protected]
help: Run "pnpm approve-builds" to pick which dependencies should be allowed
to run scripts.
⚠ Migration requires follow-up work.
- Ngôn ngữ chính
- TypeScript
- Star
- 993
- Fork
- 65
- Merge trung bình
- 18 giờ 28 phút
- Pull request đã merge (30 ngày)
- 207
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của cloudflare/cf
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
cloudflare/cf#344 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
upstream
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
cloudflare/cf#262 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`cf dev` rejects `--port` and `--host` for Vite projects, including the `cf init` templateCó thể đã có người làm @jamesopstad đã nhận 23 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
cloudflare/cf#223 · 2 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
upstream
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
cloudflare/cf#179 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
cloudflare/cf#510 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của cloudflare/cf
Issue tương tự
-
cloudflare-cache-binding: `unstorage://` keys are rejected by the Cache API, cache never storesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 2 ngày
-
reproduced
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
anomalyco/opencode#62052 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
strapi/design-system#2084 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày