dioxus
dioxus copied to clipboard
I/O error dx hot reload
Problem
Running both Tailwind watch and Dioxus hot-reload, during reload I get:
[ERROR] I/O Error: Unable to access the file. The file is being used by another process. (os error 32)
Maybe it try to watch the public folder that is already used by the tailwind watcher.
Steps To Reproduce
Steps to reproduce the behaviour:
Open a terminal and run npx tailwindcss -i ./input.css -o ./public/tailwind.css --watch
to generate public/tailwind.css each time the input.css was modified.
Open another terminal and run dx serve --platform desktop --hot-reload
.
Try to write/change an rsx! or a CSS.
Expected behavior
Hot reload must run and I can see the new content/style.
Environment:
- Dioxus version: [0.4]
- Rust version: [1.70.0]
- OS info: [Windows 11]
- App platform: [desktop]
Questionnaire
- [ ] I'm interested in fixing this myself but don't know where to start
- [ ] I would like to fix and I have a solution
- [ ] I don't have time to fix this right now, but maybe later
I tried to remove Tailwind from dioxus.toml, from public folder and from the custom head, but the error still remains..so I guess Tailwind was not the problem..
If you check your task manager, are there any other instances of the dioxus cli running? I wonder if there is a conflict when two instances try to write to the hot reloading socket
It is strange...I also restart my computer and nothing changes...but I noticed that if I run only dx serve
it hot reload right (without args hot-reload and platform)...
dx serve
will rebuild your application when it notices any changes. dx serve --hot-reload
will patch the rsx without recompiling when it notices any changes
Ok, thanks for the explanation. In the activity monitor I didn't find any cargo process tho.
I search for dioxus, dx, cargo...nothing is listed in activity monitor. I tried to use another code editor, another terminal....but I always get that error..with and without tailwind...I tried to create a new project from scratch with dx create but the error still...
I'm encountering the exact same problem.
- Dioxus version: [0.4]
- Rust version: [1.72.1]
- OS info: [Windows 10]
- App platform: [desktop]
That's probably because I'm using the desktop renderer from crates.io. Documentation says hot reloading works on desktop renderer with git version only.
Same issue here, @JoshLambda that documentation is old, it should now work with dx serve --platform desktop --hot-reload
The documentation for 0.4 is here
Some additional information would be very helpful debugging this issue:
- What does your code look like (preferably a minimal example)
- What does your workspace file system look like? Is there multiple packages, do you have local dependancies, etc
- What exact code do you change that fails to hot reload? Does hot reloading work once after you create the project or does it fail on a new project
I literally followed this page: https://dioxuslabs.com/learn/0.4/getting_started/liveview
Code is exactly the example (plus imports), then run dx serve --hot-reload --platform desktop
as specified and modified the "Hello, world!" in "Helloo, world!", but any change causes the error. The hotreload fails every time (I can still manually reload the web page to see changes)
No workspace or other packages other than the one specified in the example (axum, dioxus, dioxus-liveview, tokio)
I'm also on Windows (10, not 11) if that can help
I can reproduce the liveview issue on macos
. I see a flash of compiling...
which should happen when dioxus-cli
sees something that is not static rsx that is changed. I don't see the same error on macos
for desktop