Windows: laravel dev server fails to replace executable while queue worker is running
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by inspecting the generated Rust starter's package.json scripts for laravel dev, dev:queue, and dev:server, then trace how those scripts invoke Cargo and nodemon on Windows. Reproduce the reported failure and compare it with the separate CARGO_TARGET_DIR workaround. Done means the server, queue worker, and Vite start together on Windows without Cargo failing to replace the executable; linked pull request #139 is already open.
Written by the indexing model from the issue text.
Description
Description
On Windows, the default Rust starter's laravel dev can fail to start the web server because Cargo cannot replace the application executable while the queue worker is running it.
Environment
- Windows x64, build 26300
- Laravel CLI 0.3.0
- Rust 1.100.1
- Node.js 26.14.0, npm 11.21.3
- Newly created Laravel Rust starter
Steps to reproduce
- Create a Rust application with
laravel new demo-laravel-rustand select Rust. - From the application directory, run
laravel dev.
Actual result
The Vite server starts and the queue worker runs, but the server process fails:
[server] Blocking waiting for file lock on build directory
[server] error: failed to remove file `...\demo-laravel-rust\target\debug\demo-laravel-rust.exe`
[server] Caused by:
[server] Access is denied. (os error 5)
[queue] Processing jobs from `database:default`. Press Ctrl+C to stop.
[server] [nodemon] app crashed - waiting for file changes before starting...
While this happened, the queue worker process was running target\debug\demo-laravel-rust.exe queue:work. Both the server and queue scripts invoke Cargo against the same target directory. The running executable locking the file on Windows is a likely cause; I have not traced the operating system file lock directly.
Expected result
laravel dev starts the server, queue worker, and Vite without the server failing to replace the executable.
Workaround tested
Changing the Windows dev:queue script in package.json to set a separate target directory lets the server and queue use different executables:
"dev:queue": "set CARGO_TARGET_DIR=target\\queue&& nodemon --watch src --watch Cargo.toml --watch Cargo.lock --watch .env --ext rs,toml,lock,env --delay 300ms --signal SIGTERM --exec \"cargo run --quiet -- queue:work\""
After that change, a brief laravel dev test showed the server listening on 127.0.0.1:8000, Vite ready, and the queue worker starting, without the access error. The test did not verify processing a job. This script syntax is Windows-specific and is provided as a workaround, not a proposed cross-platform fix.
The original run also showed a separate PostgreSQL connection warning because no database was listening on 127.0.0.1:5432.
- Dominant language
- Rust
- Stars
- 2.2k
- Forks
- 105
- Avg merge
- 7h 19m
- Merged PRs (30d)
- 41
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from laravel/rust
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
laravel/rust#98 · 8 comments · 10 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
neuralmagic/crucible#579 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
laravel/rust-framework#864 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
eclipse-score/kyron#249 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
seanmonstar/reqwest#3157 ·
Maintainers usually reply within 2 days