workers-rs icon indicating copy to clipboard operation
workers-rs copied to clipboard

[BUG] cargo workspace project, how to config worker-build? worker-build error, but missing info can't resolve.

Open ganluo960214 opened this issue 1 month ago • 3 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

What version of workers-rs are you using?

0.7

What version of wrangler are you using?

4.45.3

Describe the bug

cargo project struct

root
|
|--|--worker
|
|--wrangler.toml

cmd

>worker-build ./worker
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...

[INFO]: Optimizing wasm binaries with `wasm-opt`...
[INFO]: Optional fields missing from Cargo.toml: 'description', 'repository', and 'license'. These are not necessary, but recommended
[INFO]: :-)Done in 15.90s
[INFO]: :-) Your wasm pkg is ready to publish at next_sight_cloudflare_worker\build.
Error: The system cannot locate the specified path. (os error 3)

what's error is this? The system cannot locate the specified path.

wrangler.toml

name = "next_sight_cloudflare_worker"
main = "build/worker/shim.mjs"
compatibility_date = "2024-10-06"
send_metrics = false

[dev]
ip = "0.0.0.0"
port = 8787
local_protocol = "http"

[build]
command = "worker-build --dev"


[observability]
enabled = true

Steps To Reproduce

No response

ganluo960214 avatar Nov 27 '25 12:11 ganluo960214

You need to run worker-build from within the folder being built - cd worker && worker-build.

guybedford avatar Nov 28 '25 02:11 guybedford

so there is no solution?

ganluo960214 avatar Nov 29 '25 00:11 ganluo960214

I think we should improve the error here, instead of bailing with a bad error like this though.

guybedford avatar Nov 29 '25 09:11 guybedford