Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[windows+fullstack] dx serve hotreload/rebuild fails with "The process cannot access the file because it is being used by another process." #3267

Closed
johnny-smitherson opened this issue Dec 1, 2024 · 1 comment

Comments

@johnny-smitherson
Copy link

Problem

Using the hotreload feature on windows usually gets stuck after a couple of rebuilds. The message it is stuck on is this:

22:24:55 [dev] Full rebuild: \src\main.rs
22:25:02 [dev] Build failed: IO(Os { code: 32, kind: Uncategorized, message: "The process cannot access the file because it is being used by another process." })

This is because windows has its funny filesystem concurrency model where you can't edit/delete a file currently opened by a different process. This happens for the "server" target as shown in the new CLI.

I believe the server executable might be running while dx attempts to overwrite it with the new version. I don't know how to find out for sure through - dx serve --trace has no indication of what file it's talking about

Steps To Reproduce

Steps to reproduce the behavior:

  • install windows 11, vscode, rust-analyzer
  • dx new, pick fullstack example, either update dioxus to 0.6-alpha.5 or keep at 0.5, both reproduce bug
  • edit some component rust code (not inside rsx, but inside component logic)
  • after a few rebuilds, you will get the error

Expected behavior

No error

Screenshots

Screenshot 2024-12-01 223906

Reloader is stuck after that, will no longer follow edits. After Ctrl-C and re-run, it works:

Screenshot 2024-12-01 224011

Environment:

  • Dioxus version: 0.5 + 0.6-alpha.5
  • Rust version: rustc 1.82.0 (f6e511eec 2024-10-15)
  • OS info: Windows 111
  • App platform: Fullstack

Questionnaire
I'm interested in fixing this myself but don't know where to start - is there some kind of ptrace for windows?

@johnny-smitherson
Copy link
Author

duplicate #3262 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant