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

Uncaught TypeError: Cannot read property 'forEach' of undefined at Object.injectIntoGlobalHook #205

Open
Matrixbirds opened this issue Nov 5, 2021 · 2 comments

Comments

@Matrixbirds
Copy link

Matrixbirds commented Nov 5, 2021

Hi guys, I m using electron-devtools-installer in my electron apps.

reproduce steps:

  1. 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));
  1. 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.

  1. find the userData path.
  2. delete extensions folder.
  3. re-install react-devtools by electron-devtools-installer.
@Matrixbirds
Copy link
Author

Suggestion:

  1. How to handle notification about old extensions plugin to upgrade the latest version or stable version.

@julianmesa-gitkraken
Copy link

@Matrixbirds This PR will download the required devtools: #210
At now chrome version passed to the chrome store is 32, so yo get an old devtools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants