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

Closed
Matrixbirds opened this issue Nov 5, 2021 · 3 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

@MarshallOfSound
Copy link
Owner

Hey folks, appreciate your usage of electron-devtools-installer. We're going through a bit of spring cleaning and closing out all the old issues that haven't been looked at.

This doesn't mean I'm ignoring you, it just means I don't have the time to catch up on 4 years of GitHub issue backlog

If this issue is still impacting you on the latest release of electron-devtools-installer and a supported release of Electron (see https://releases.electronjs.org) please raise a new issue with a solid repro case and detailed instructions.

@MarshallOfSound MarshallOfSound closed this as not planned Won't fix, can't repro, duplicate, stale Dec 17, 2024
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

3 participants