-
-
Notifications
You must be signed in to change notification settings - Fork 375
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
hmr fix #417
hmr fix #417
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a ton @zouhir ❤️ 😍
|
||
if (!isProd) { | ||
entry['hmr'] = `webpack-dev-server/client?http://localhost:${process.env.PORT || env.port || 8080}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a temporary fix with with we can go for now. But I guess the HMR failure is related to webpack-dev-server or html-webpack-plugin.
Once it is fixed in the upstream, we can clean this off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's webpack-dev-server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any chance the port
change is unnecessary here?
@developit the port in here has to exactly be your devServer port option otherwise you'll get console messages that socket can't connect, therefore no hmr. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks @zouhir! Totally forgot about this approach 🎉
Thank you so much for fixing this! We definitely tort this upstream in case someone hasn't already. |
I have a little preact-cli project I work with on weekends.
Today HMR stopped working and I am able to get it to work back via this fix.
dev-server was not emitting socket-js with the dev bundle and seems like the combo of Webpack HMR plugin +
hot:true
in dev-server options is not working.This fix will ensure in Dev mode, the required socket stuff are committed to
hmr
bundle and the reload happens.is there better ideas? happy to discuss.