Problems with wrangler when developing worker in Rust

I have a worker that's written in Rust and I'm trying to run it locally with npx wrangler dev. During compilation of my code I get this error
/home/alexander/.npm/_npx/32026684e21afda6/node_modules/wrangler/wrangler-dist/cli.js:29573
throw a;
^

ReferenceError: Cannot access 'entry' before initialization
at getDevReactElement (/home/alexander/.npm/_npx/32026684e21afda6/node_modules/wrangler/wrangler-dist/cli.js:171671:11)
at FSWatcher.<anonymous> (/home/alexander/.npm/_npx/32026684e21afda6/node_modules/wrangler/wrangler-dist/cli.js:171633:26)
at FSWatcher.emit (node:events:519:28)
at FSWatcher.emit (node:domain:488:12)
at FSWatcher.emitWithAll (/home/alexander/.npm/_npx/32026684e21afda6/node_modules/chokidar/index.js:540:8)
at FSWatcher._emit (/home/alexander/.npm/_npx/32026684e21afda6/node_modules/chokidar/index.js:632:8)
at listener (/home/alexander/.npm/_npx/32026684e21afda6/node_modules/chokidar/lib/nodefs-handler.js:370:20)

Node.js v21.7.1
/home/alexander/.npm/_npx/32026684e21afda6/node_modules/wrangler/wrangler-dist/cli.js:29573
throw a;
^

ReferenceError: Cannot access 'entry' before initialization
at getDevReactElement (/home/alexander/.npm/_npx/32026684e21afda6/node_modules/wrangler/wrangler-dist/cli.js:171671:11)
at FSWatcher.<anonymous> (/home/alexander/.npm/_npx/32026684e21afda6/node_modules/wrangler/wrangler-dist/cli.js:171633:26)
at FSWatcher.emit (node:events:519:28)
at FSWatcher.emit (node:domain:488:12)
at FSWatcher.emitWithAll (/home/alexander/.npm/_npx/32026684e21afda6/node_modules/chokidar/index.js:540:8)
at FSWatcher._emit (/home/alexander/.npm/_npx/32026684e21afda6/node_modules/chokidar/index.js:632:8)
at listener (/home/alexander/.npm/_npx/32026684e21afda6/node_modules/chokidar/lib/nodefs-handler.js:370:20)

Node.js v21.7.1
After this, it looks like the process stops (I get a new blank line in my terminal) but actually it continues in the background and once it is finished get some more lines printed
[INFO]: Optional field missing from Cargo.toml: 'license'. This is not necessary, but recommended
[INFO]: ✨ Done in 2m 03s
[INFO]: 📦 Your wasm pkg is ready to publish at /home/alexander/work/simpl/simpl-energy/simpl-energy-api-v0/build.

shim.mjs 27.0kb

⚡ Done in 8ms
[INFO]: Optional field missing from Cargo.toml: 'license'. This is not necessary, but recommended
[INFO]: ✨ Done in 2m 03s
[INFO]: 📦 Your wasm pkg is ready to publish at /home/alexander/work/simpl/simpl-energy/simpl-energy-api-v0/build.

shim.mjs 27.0kb

⚡ Done in 8ms
At this point the server has not started and it looks like that never happens to I kill the program with ctrl + c. If I then run npx wrangler dev again, without making any changes to my code, the server starts correctly. The same problem happens when making changes to my code that require a recompilation.
0 Replies
No replies yetBe the first to reply to this messageJoin