-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Hotreloading doesn't work with lowercase and/or .mjs entrypoint #128
Comments
Capital letters are needed to distinguish components, yes. This goes for React and Preact. I think we're missing |
@rschristian ah interesting, wouldn't changes in other lowercase components fail in that case? All other components are lowercased and have working HMR as long as the entrypoint is in uppercase. |
Hm, not sure, but you definitely shouldn't be using components that start with a lowercase letter. From Prefresh's docs:
Edit: Both Prefresh & our preset here need fixes, will PR accordingly shortly. |
Thanks for the quick reply & fix! 🎉 |
No problem, thanks for taking the time to raise an issue! It's pretty late here so I'll have to make a release for our Vite preset tomorrow -- hopefully it's a quick task w/ Edit: Sorry, I'm going to wait to see if #130 needs a fix too |
First of all, I'm not sure if this is the correct place or whether this is more
prefresh
related... Also Preact is truly awesome!Writing a small webapp using the latest vite and preact versions and I recently figured out why HMR was not working.
Fixed it by changing my entrypoint function name from
app
toApp
and renaming the file it resides in fromapp.mjs
toapp.js
. It seems the combination of these two is needed, applying either alone doesn't fix HMR.Basically:
I hope this is enough information, let me know if I can help out in any way in debugging this.
The text was updated successfully, but these errors were encountered: