when i change main.ts throw error flash back window
icyfe opened this issue · 3 comments
icyfe commented
yteruel31 commented
Remove '..',
at hot reloading bloc.
The treatment should be like this (./electron/main.ts) :
// Hot Reloading
if (isDev) {
// 'node_modules/.bin/electronPath'
require('electron-reload')(__dirname, {
electron: path.join(__dirname, '..', 'node_modules', '.bin', 'electron'),
forceHardReset: true,
hardResetMethod: 'exit'
});
}
Romex91 commented
Remove
'..',
at hot reloading bloc.The treatment should be like this (./electron/main.ts) :
// Hot Reloading if (isDev) { // 'node_modules/.bin/electronPath' require('electron-reload')(__dirname, { electron: path.join(__dirname, '..', 'node_modules', '.bin', 'electron'), forceHardReset: true, hardResetMethod: 'exit' }); }
Didn't work for me.
What did work is replacing 'electron' with 'electron.cmd':
// Hot Reloading
if (isDev) {
require("electron-reload")(__dirname, {
electron: path.join(
__dirname,
"..",
"..",
"node_modules",
".bin",
"electron" + (process.platform === "win32" ? ".cmd" : "")
),
forceHardReset: true,
hardResetMethod: "exit",
});
}