Hi guys, I m using electron-devtools-installer in my electron apps.
reproduce steps:
integration code in electron main code.
const installExtension = require("electron-devtools-installer");
// TODO: replace official package version
// when writing this code, electron-devtools-installer has not released the latest version
// Expected version, greater than: v3.1.1
installExtension
.default([installExtension.REACT_DEVELOPER_TOOLS], {
loadExtensionOptions: {
allowFileAccess: true,
},
})
.catch((err: Error) => console.log("added extension failed", err));
bootstrap main process.
Got Error Uncaught TypeError: Cannot read property 'forEach' of undefined at Object.injectIntoGlobalHook.
Found many solutions about this error is indicating when using old verions react devtools, caused the conflict with react react-refresh/src/ReactFreshRuntime.js
Solutions:
We can see the userData is the folder to save the react-devtools in extensions folder.
find the userData path.
delete extensions folder.
re-install react-devtools by electron-devtools-installer.
Hi guys, I m using electron-devtools-installer in my electron apps.
reproduce steps:
Got Error
Uncaught TypeError: Cannot read property 'forEach' of undefined at Object.injectIntoGlobalHook
.Found many solutions about this error is indicating when using old verions react devtools, caused the conflict with react react-refresh/src/ReactFreshRuntime.js
Solutions:
We can see the userData is the folder to save the react-devtools in extensions folder.
userData
path.electron-devtools-installer
.