Unable to get server-side hot reloading working
See original GitHub issueThanks for this project. I’m having trouble getting hot reloading to work, so I thought I would create a “hello world” complete project to demonstrate. https://github.com/cmoad/koa-webpack-hmr-test
You should be able to clone the above repo then npm install
and npm start
.
If I curl localhost:5000
I get ok
. I then change ok
to test
in index.js
. I can see webpack recompile on the command line, but if I curl localhost:5000
I still get ok
.
I should also note that I can’t get webpack to run without the plugin, new webpack.IgnorePlugin(/webpack/)
. Without that I see a lot of Module not found
and Module parse failed
from webpack dependencies.
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (4 by maintainers)
Top Results From Across the Web
webpack-dev-server hot reload not working - Stack Overflow
When I change a file I can see in terminal that a rebuild is happening but nothing happens in the browser. Am I...
Read more >React hot reload not working for changes made in index.js
Changes made in index.js is not reflecting on the UI, hence hot reloading fails. For all other files, hot reload works just fine...
Read more >.NET Hot Reload support for ASP.NET Core | Microsoft Learn
Use .NET Hot Reload to apply code changes to a running app without restarting the app and without losing app state.
Read more >Blazor Hot reload not working when debugging
I'm using the latest preview of VS 2022 and I have a Blazor app -asp.net core hosted-. When I run the app -F5-...
Read more >HotReloading not working? - RedwoodJS Community
I have a bizarre issue where my hot reloading isn't working correctly and I can't figure out where to start figuring out why...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I believe I just ran into this myself and the issue was my babel config that prevented my hot reloading using es6 import statements… if your code hot reloads when you change to require(), try changing your babel options in webpack.config.js to something along these lines…
module: { rules: [ { test: /\.js$/, exclude: /node_modules/, use: { loader: 'babel-loader', options: { "presets": [ ["env", { "modules": false, "targets": { "node": "current" } }] ], "plugins": [ "transform-object-rest-spread" ] } } } ] },
that babel-preset-env setup should get es6 import code hot reloading properly in node server side code, sorry for the crap word wrapped paste from vscode ><
Wait, I just noticed https://github.com/shellscape/koa-webpack/issues/81, which may be a dupe of this issue, but more importantly, I also found https://github.com/webpack-contrib/webpack-hot-client/issues/8, which is what I think I’m running into. Going to go through that issue’s comments’ instructions.