Windows: laravel dev server fails to replace executable while queue worker is running

Open
#115 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@arjunastrw is already working on this.

Since Dec 3, 2026.

  • #139 by @arjunastrw — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
node.js, rust
Domain
backend, devtools

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
  1. Create a Rust application with laravel new demo-laravel-rust and select Rust.
  2. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from laravel/rust

All issues in laravel/rust

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.