Skip to content
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

Hot module reloading doesn't work in Electron 7 #110

Open
vinceau opened this issue Nov 30, 2020 · 0 comments
Open

Hot module reloading doesn't work in Electron 7 #110

vinceau opened this issue Nov 30, 2020 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@vinceau
Copy link
Owner

vinceau commented Nov 30, 2020

I noticed that hot module reloading (HMR) doesn't work all the time anymore. HMR used to work fine and would correctly reload the app whether changes were made to the renderer thread or the main thread. Somewhere along the lines, HMR broke. I've managed to narrow down the culprit to one of these commits.

My understanding is that this issue with HMR likely stems from the fact that we are using this hacky workaround introduced in 2e4d3e0:

if (isDevelopment) {
  app.prependOnceListener("ready", startUp);
} else {
  app.on("ready", startUp);
}

As a recap, in #100 we upgraded Electron from version 4.1.1 to 7.3.2, due to vulnerabilities found in version 4. The twitch-electron-auth-provider package works with Electron as a peer dependency up to versions < 9.0.0, so we could have installed any Electron up til version 8. So why did we settle on 7.3.2? As evident in the commits, initially we had upgraded to Electron to 8.4.1, but it caused the console to be spammed with DevTools failed to parse SourceMap warning messages. At the time of writing, it seems like there is still no fix available for this, and in addition, this issue also plagues later versions as well including version 9 and version 10.

And so, we're stuck with version 7 of Electron. But version 7 has this very strange bug with Windows 10 dark mode, where the ready event doesn't fire in dev mode (yes, really) and thus not opening the app. So we use the hacky workaround as initially described here to get around opening the app in dev mode.

Which leads me to repeat that I believe this workaround is the cause of HMR not working. I'm still not sure what the best path forward in regards to this.

In conclusion: I hate Electron.

@vinceau vinceau added the help wanted Extra attention is needed label Nov 30, 2020
@vinceau vinceau changed the title Hot module reloading doesn't work consistently Hot module reloading doesn't work in Electron 7 Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant