Closed akomm closed 2 months ago
There's a couple different issues being conflated in this thread. Here are my current thoughts for disentangling them:
remix dev
without --manual
If you are not using the -c
flag for a custom server, there should be no reason not to use the --manual
flag as it provides better DX anyway. remix dev
without --manual
should work too; if it doesn't currently, that's a bug. But in any case, I'd recommend just using remix dev --manual
:
- remix dev
+ remix dev --manual
If you are using the -c
flag for a custom server, check out our docs for manual mode.
wrangler
+ HMRHMR seems to only work with wrangler
<= 3.8.0 . Unsure if this is a bug in newer wrangler
versions or (more likely) a race condition that is only prevalent for wrangler
3.9+. These sort of "file access" race conditions are only possible because we are coordinating the app server and the dev server via file writes (i.e. writing the server build to disk).
The principled solution is to not rely on files at all for coordination, which is exactly what Vite does. In fact, solving this type of race condition is exactly what first motivated me to look into Vite.
So in all likelihood, the workaround will be to stay on wrangler
<= 3.8 until Vite (w/ CloudFlare support) is stabilized. Which is literally the thing I'm working on now. No promises on exact date, but rest assured its actively being worked on.
If you have issues other than the two I mentioned here, it'd be great to track those in separate GitHub issues with specifics for your particular issue so we can make sure to prioritize those fixes accordingly.
I'm seeing the same behavior as described in this comment in a fresh Remix 2.4.1 project. The only difference is that switching to express did not fix the issue for me. Editing out the line in remix-serve.js did fix it.
I'm seeing the same behavior as described in this comment in a fresh Remix 2.4.1 project. The only difference is that switching to express did not fix the issue for me. Editing out the line in remix-serve.js did fix it.
custom server only fixed it because it was used in combination with the --manual
flag. I did not mentioned it in the comment, because I did it before. Just wanted to clarify. Maybe you do not need to edit the line if you add --manual
flag.
Closing this since Remix Vite has obsoleted the old esbuild-based dev server that used the --manual
flag.
What version of Remix are you using?
2.0.0 update: 2.0.1 tested, still present
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
Just install this template as in README.md:
https://github.com/remix-run/remix/tree/main/templates/remix
Try change root.tsx in dev mode
Expected Behavior
content is reloaded
Actual Behavior
The file hash and timestamp obviously vary.
Tested with: Firefox 106 Chromium 116