HMR / LiveReload not working
See original GitHub issue- I have read the contribution documentation for this project.
- I agree to follow the code of conduct that this project follows, as appropriate.
- I have searched the issue tracker for an issue that matches the one I want to file, without success.
Please describe your issue:
Hi there, I can’t get the livereload working with my app. It was crearted with electron-forge init --template=react
. Here is the console output from the devtools when I just hit Cmd+S on any project file (to trigger HMR).
require-hook.js:25 Uncaught TypeError: fn is not a function
at window.__hot.forEach.fn (/Users/jtanay/dev/cortex/node_modules/electron-compile/lib/require-hook.js:36:34)
at Array.forEach (native)
at EventEmitter.electron.ipcRenderer.on (/Users/jtanay/dev/cortex/node_modules/electron-compile/lib/require-hook.js:36:20)
at emitOne (events.js:96:13)
at EventEmitter.emit (events.js:188:7)
window.__hot.forEach.fn @ require-hook.js:25
electron.ipcRenderer.on @ require-hook.js:25
emitOne @ events.js:96
emit @ events.js:188
require-hook.js:25 Uncaught TypeError: fn is not a function
at window.__hot.forEach.fn (/Users/jtanay/dev/cortex/node_modules/electron-compile/lib/require-hook.js:36:34)
at Array.forEach (native)
at EventEmitter.electron.ipcRenderer.on (/Users/jtanay/dev/cortex/node_modules/electron-compile/lib/require-hook.js:36:20)
at emitOne (events.js:96:13)
at EventEmitter.emit (events.js:188:7)
window.__hot.forEach.fn @ require-hook.js:25
electron.ipcRenderer.on @ require-hook.js:25
emitOne @ events.js:96
emit @ events.js:188
I tried with a blank project (electron-forge init --template=react
)and it was working like a charm.
Console output when you run electron-forge
with the environment variable DEBUG=electron-forge:*
. (Instructions on how to do so here). Please include the stack trace if one exists.
DEBUG=electron-forge:* yarn start
yarn start v0.23.4
$ electron-forge start
WARNING: DEBUG environment variable detected. Progress indicators will be sent over electron-forge:lifecycle
electron-forge:lifecycle Process Started: Checking your system +0ms
electron-forge:lifecycle Process Succeeded: Checking your system +18ms
electron-forge:runtime-config setting key: verbose to value: false +6ms
WARNING: DEBUG environment variable detected. Progress indicators will be sent over electron-forge:lifecycle
electron-forge:lifecycle Process Started: Locating Application +0ms
electron-forge:project-resolver searching for project in: /Users/jtanay/dev/cortex +2ms
electron-forge:project-resolver electron-forge compatible package.json found in /Users/jtanay/dev/cortex/package.json +7ms
electron-forge:lifecycle Process Succeeded: Locating Application +1ms
electron-forge:lifecycle Process Started: Preparing native dependencies +1ms
electron-forge:lifecycle Process Succeeded: Preparing native dependencies +136ms
electron-forge:hook could not find hook: generateAssets +6ms
electron-forge:lifecycle Process Started: Launching Application +2ms
electron-forge:lifecycle Process Succeeded: Launching Application +5ms
2017-05-08 14:56:06.623 Electron Helper[7157:204567] Couldn't set selectedTextBackgroundColor from default ()
HMR sent to all windows!
What command line arguments are you passing?
No specific arguments.
What does your config.forge
data in package.json
look like?
{
"make_targets": {
"win32": [
"squirrel"
],
"darwin": [
"zip",
"dmg"
],
"linux": [
"deb",
"rpm"
]
},
"electronPackagerConfig": {
"asar": true,
"quiet": true
},
"electronWinstallerConfig": {
"name": "Cortex"
},
"electronInstallerDebian": {},
"electronInstallerRedhat": {},
"github_repository": {
"owner": "",
"name": ""
},
"windowsStoreConfig": {
"packageName": "",
"name": "Cortex"
}
}
Please provide either a failing minimal testcase (with a link to the code) or detailed steps to
reproduce your problem. Using electron-forge init
is a good starting point, if that is not the
source of your problem.
Please tell me if I can help.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Hey @Djiit @MarshallOfSound , I’m using react-boilerplate and have the same issue. I’ve removed module.hot.accept from configureStore.js, but now any hot reload breaks my entire Redux setup
Did you manage to find a way to use react-redux with Electron Forge v5.x?
Thanks.
Yep, here it is (
index.html
) :