ITADN

[BUG] wrangler crashed on code changes, but only on consecutive build

#927Closedextraymond 创建于 2026-02-07
E
extraymondcommented
### Is there an existing issue for this? - [x] I have searched the existing issues ### What version of `workers-rs` are you using? 0.7.4 ### What version of `wrangler` are you using? 4.63.0 ### Describe the bug when trying the cargo generate template following the tutorial, running npx wrangler have some weird behaviour, it crashed after the build process and complains about unexpected output my suspect is that the worker-build command produces some stdout that are not expected by wrangler and while the command is stdout without stderr, it's picked and stopped the process ### Steps To Reproduce 1. run cargo generate to download the template 2. run npx wrangler dev 3. the first pass is ok 4. made some code changes 5. wrangler rebuild, and it crashed 6. also tried disabling wasm-opt via Cargo.toml, or supply wasm-opt and wasm-bindgen from env-var, problem still persist relevant part of the log, it said something about wasm-opt, but the code compiled on running wrangler dev, i think the logic on checking for a rebuild is different on first try ``` 'warning: `test-cf-axum` (lib) generated 2 warnings\n' + ' Finished `release` profile [optimized] target(s) in 3.89s\n' + '[INFO]: Optimizing wasm binaries with `wasm-opt`...\n' + 'Error: No such file or directory (os error 2)\n' + 'To disable `wasm-opt`, add `wasm-opt = false` to your package metadata in your `Cargo.toml`.', ``` --- current workaround to suppress this 1. I try to hide the stdout and only redirect it if it failed 2. change wrangler.toml ``` [build] command = "out=$(cargo install -q worker-build@^0.7 && worker-build --release 2>&1) || echo '$out'" ``` 3. any further code changes only forwarded to warngler if worker-build can't build the code
关闭于 2026-02-25 2 条评论