-
Notifications
You must be signed in to change notification settings - Fork 85
Please clarify wether HMR should work in the new version #72
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
Comments
Yes the app does does reload,can you send me your full webpack config? Also are you using webpack 4? |
I mean the idea with HMR is that it should not reload, right? My Webpack config is somewhat generated. My issue is that with the old approach of using "style-loader" in development HMR works as expected while when using this plugin it just doesn't seem to correctly trigger the required changes. |
Seems like Webpack itself is doing fine:
There seems to be a CSS file being generated. Looks like an issue with the client side. |
Ahh yeah I get it. Using something like webpack merge. So the main thing to enable hot, is that there’s some kind of ref in the entry point.
Let me get on my computer and I’ll send you examples. If I had a consoles logged version of your webpack it would help. But I’ll send you what I have locally.
Alternatively I can just add hot:true to the plugin
…Sent from my iPhone
On Jun 5, 2018, at 10:33 AM, Sebastian Werner ***@***.***> wrote:
I mean the idea with HMR is that it should not reload, right?
My Webpack config is somewhat generated.
My issue is that with the old approach of using "style-loader" in development HMR works as expected while when using this plugin it just doesn't seem to correctly trigger the required changes.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Are you trying to hash the css files? can’t hash them in development mode
…Sent from my iPhone
On Jun 5, 2018, at 10:38 AM, Sebastian Werner ***@***.***> wrote:
Seems like Webpack itself is doing fine:
98% after emittingCompleted client bundle in 2.914s!
ℹ 「hot」: webpack: Compiling Done
ℹ 「wdm」: Version: webpack 4.11.0
Time: 13914ms
Built at: 05.06.2018 16:37:12
Entrypoint main = main-c29587bba029864b102d.css index.js main.ef57d98abc586b5abd48.hot-update.js
ℹ 「wdm」: Compiled successfully.
There seems to be a CSS file being generated. Looks like an issue with the client side.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Yep, it's Webpack v4.11.0 right now. Everything using latest versions. |
It would be helpful to see the entry config and what you pass to entries
…Sent from my iPhone
On Jun 5, 2018, at 10:39 AM, Sebastian Werner ***@***.***> wrote:
Yep, it's Webpack v4.11.0 right now. Everything using latest versions.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I do hash them I figure. |
I’m on my phone at the moment. But class check the build and see if there’s any console warnings that were thrown |
Hashing was clearly an issue, conceptually, but does not fix the issue when disabled. New output:
|
Content of the transferred files: {"h":"59574152234a740a3f28","c":{"main":true}} webpackHotUpdate("main",[]) This seems to be a little too light. |
BTW I am using the new dev-server "webpack-serve". So no SSR in place right now. |
There are no warnings. It's really just not working. Webpack output itself looks fine. |
Okay, I think know the issue. Do you have a repo that I can fix it on? I think for your immediate relief, im going to add hot:true to the plugin part |
Sorry, it's in a private repo of a customer of mine. Can't really share that. |
I can hack into the code of your plugin though to try it out... if you give me an idea of where to look. |
No I fully understand! Give me a second and ill release a @next on npm which should resolve your issue |
hmr : true should solve this issue |
@manjula91 on the plugin or setting it in the webpack options? |
Okay guys Im testing a fix for this @manjula91 @swernerx Try How I currently expect things. If you can send a snippet of were you define HOT, it will be very helpful! devServer: {
contentBase: __dirname,
hot: true,
}, OR entry: {
dev: './dev/javascript',
index: [
'webpack/hot/only-dev-server',
`webpack-hot-middleware/client?path=${config.host}:${config.port}/__webpack_hmr`,
'./src/client/index.js'
]
}, |
Or |
Automatic detection seems to miss a few scenarios, as a last resort. You can now add hot:true fix #72
Let me know fi this helps, im at work otherwise id dedicate full time to fix it. if you still have issues. What I had was a conditional checking the the process.env.NODE_ENV === development secondly I have a function that determines is you use HMR However id either are false. it won't add. For the time being you can just add hot:true to the plugin Might appreciate the patience |
Thanks. The new flag is fixing my issue. |
Still not working for me with
Using |
Uninstall reinstall @latest it’s out of beta.
…On Thu, Jun 14, 2018 at 4:51 PM Will Hauck ***@***.***> wrote:
Still not working for me with hot: true, sadly. A hot update is triggered
but it's empty:
webpackHotUpdate("main",[])
Using ^3.0.4-beta.1.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#72 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AYGpTGaSfwJBUJR4UEdExVH5TmBmZuGTks5t8szPgaJpZM4Ua2jd>
.
|
No luck on @latest unfortunately. |
@hauckwill if you can, throw me a repo and ill check it |
Unfortunately the full repo is not mine to share, but here's my webpack config: Using Really appreciate the help and the work you've put into this. |
@hauckwill Ping me on https://gitter.im/Reactlandia It will be easier & faster for me to assist over a private IM |
I just want to figure out wether HMR should work with the newest version. I am using the newest version of both this plugin and webpack. It seems that CSS changes are correctly triggering HMR, but in the end nothing happens. This is the client-side log output:
Re-loading the app manually works fine though.
This is my loader config for CSS files:
Any hints? Previously with
mini-css-extract-plugin
I used thestyle-loader
during development. Is this also the way to go with this plugin?The text was updated successfully, but these errors were encountered: