-
Notifications
You must be signed in to change notification settings - Fork 1.5k
HMR not working as expected, reloads page instead #437
Comments
Same issue |
I have the same issue. |
Your patch works for me @rmartinm, thank you. |
Sorry for late reply everyone. Just as @MarlBurroW mentioned, this is a dependency issue. Going to disable this until it is resolved. This patch will enable HMR to work as expected, but will not reload the page when Related |
Hi, it's been a long time since this problem has not been solved. I updated my dependencies recently, and I now have a similar behavior, while I'm using this workaround. Could someone confirm or invalidate this, please? Here is my packages versions, from a fresh
FYI, I have exactly the same behavior with my project, which have all dependencies versions updated. From the electron console, I can get these messages, I do not understand it but maybe someone will:
I'm working on a new configuration with webpack-hot-middleware without webpack-dev-server, I'll let you know if I have something valuable for the community. PS: thank you all for what you've done with electron-vue, it helps me a lot while setup a whole Electron app project with HMR, testing, etc. Love you guys! |
Have the same problem |
After quite some time looking for a solution to this on my own project, I realized that the Open up .electron-vue/dev-runner.js and change from const server = new WebpackDevServer(
compiler,
{
contentBase: path.join(__dirname, '../'),
quiet: true,
before (app, ctx) {
app.use(hotMiddleware)
ctx.middleware.waitUntilValid(() => {
resolve()
})
}
}
) to const server = new WebpackDevServer(
compiler, {
contentBase: path.join(__dirname, '../'),
quiet: true,
hot: true, // <-- the fix!
before(app, ctx) {
// app.use(hotMiddleware) // <-- not necessary!
ctx.middleware.waitUntilValid(() => {
resolve()
})
}
}
) There's more details about the NOTE: I've updated a few versions from this template's default versions: Electron 6.0.4, Webpack 4.39.2, webpack-dev-server 3.8.0 |
This worked. Thanks a lot for the fix |
Thank you @nwittwer ! Note: when I comment the line |
@Gugwai Glad it worked! As a heads up, this is a slippery slope to find a workaround until there's an official fix. Here's what I found to fix the issue you mentioned:
It looks like Again, these changes do go off course from this project. I am just sharing what has worked for me, in hopes it will help others until there's a more official fix or community project. |
thank you @nwittwer . |
Hello, I was trying to update some components and nothing happened, but after put this config it works ! const server = new WebpackDevServer(
compiler,
{
contentBase: path.join(__dirname, '../'),
quiet: true,
hot: true,
liveReload: true,
watchOptions: {
poll: true
},
before (app, ctx) {
app.use(hotMiddleware)
ctx.middleware.waitUntilValid(() => {
resolve()
})
}
}
)
server.listen(9080)
}) |
Hot reloading components does not work at the moment (used to work just fine).
Describe the issue / bug.
When setting up a new project, hot reloading does not work.
It used to work, I have a project from about 2 weeks ago (setup the same way) where it works just fine.
How can I reproduce this problem?
vue init simulatedgreg/electron-vue my-project
yarn
yarn run dev
src/renderer/components/LandingPage/SystemInformation.vue
It will reload the whole app instead of hot-reloading the component.
Tell me about your development environment.
The text was updated successfully, but these errors were encountered: