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

REDUX_DEV_TOOLS Failed to fetch extension #215

Open
squidjam opened this issue Mar 11, 2022 · 4 comments
Open

REDUX_DEV_TOOLS Failed to fetch extension #215

squidjam opened this issue Mar 11, 2022 · 4 comments

Comments

@squidjam
Copy link

squidjam commented Mar 11, 2022

electron-devtools-installer is working properly for React Development Tools but not for Redux DevTools.

Given:
"electron-devtools-installer": "^3.2.0"
"electron": "^9.4.4"

in electron.js:
`const {
default: installExtension,
REACT_DEVELOPER_TOOLS,
REDUX_DEVTOOLS
} = require ( 'electron-devtools-installer' );

app.whenReady ().then ( () => {
    installExtension( REDUX_DEVTOOLS, {forceDownload: true, loadExtensionOptions: { allowFileAccess: true }  } )
        .then( ( name ) => console.log( `Added Extension:  ${ name }` ) )
        .catch( ( err ) => console.error( 'An error occurred "redux_devtools": ', err ) );
    installExtension( REACT_DEVELOPER_TOOLS )
        .then( ( name ) => console.log( `Added Extension:  ${ name }` ) )
        .catch( ( err ) => console.error( 'An error occurred "react_devtools": ', err ) );
} )

`

Output shows:

Failed to fetch extension, trying 3 more times
...
Failed to fetch extension, trying 2 more times
Failed to fetch extension, trying 1 more times
Failed to fetch extension, trying 0 more times
An error occurred "redux_devtools": Error: net::ERR_BLOCKED_BY_RESPONSE
at SimpleURLLoaderWrapper. (electron/js2c/browser_init.js:93:6395)
at SimpleURLLoaderWrapper.emit (events.js:223:5)

Observed behavior:
Redux devtools isn't downloaded.

@aabuelenin
Copy link

I've the same issue but it affects all extensions not just REDUX_DEVTOOLS.

Here's what I know so far:

So the culprit is CORS. I tried removing the response header by listening to onBeforeSendHeaders, onHeadersReceived and onBeforeRedirect; and modifying requests/responses. But (and this might be a bug in electron) onHeadersReceived doesn't get called for the second request, maybe because it's the result of a redirection?

@dialqueza
Copy link

dialqueza commented Mar 25, 2022

electron-devtools-installer is working properly for React Development Tools but not for Redux DevTools.

Given: "electron-devtools-installer": "^3.2.0" "electron": "^9.4.4"

in electron.js: `const { default: installExtension, REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS } = require ( 'electron-devtools-installer' );

app.whenReady ().then ( () => {
    installExtension( REDUX_DEVTOOLS, {forceDownload: true, loadExtensionOptions: { allowFileAccess: true }  } )
        .then( ( name ) => console.log( `Added Extension:  ${ name }` ) )
        .catch( ( err ) => console.error( 'An error occurred "redux_devtools": ', err ) );
    installExtension( REACT_DEVELOPER_TOOLS )
        .then( ( name ) => console.log( `Added Extension:  ${ name }` ) )
        .catch( ( err ) => console.error( 'An error occurred "react_devtools": ', err ) );
} )

`

Output shows:

Failed to fetch extension, trying 3 more times
...
Failed to fetch extension, trying 2 more times
Failed to fetch extension, trying 1 more times
Failed to fetch extension, trying 0 more times
An error occurred "redux_devtools": Error: net::ERR_BLOCKED_BY_RESPONSE
at SimpleURLLoaderWrapper. (electron/js2c/browser_init.js:93:6395)
at SimpleURLLoaderWrapper.emit (events.js:223:5)

Observed behavior: Redux devtools isn't downloaded.

We're also experiencing this in VueJS Devtools as well. What's the workaround solution for this?

@mduclehcm
Copy link

@dialqueza
I have created a workaround patch
you can try this

"electron-devtools-installer": "git+https://github.com/mduclehcm/electron-devtools-installer#mduclehcm-patch-1",

@LegacyOfKain
Copy link

LegacyOfKain commented Oct 29, 2024

For me what works is to duplicate the code by adding the install extension code twice

app.whenReady ().then ( () => {
installExtension( REDUX_DEVTOOLS, {forceDownload: true, loadExtensionOptions: { allowFileAccess: true } } )
.then( ( name ) => console.log( Added Extension: ${ name } ) )
.catch( ( err ) => console.error( 'An error occurred "redux_devtools": ', err ) );
installExtension( REACT_DEVELOPER_TOOLS )
.then( ( name ) => console.log( Added Extension: ${ name } ) )
.catch( ( err ) => console.error( 'An error occurred "react_devtools": ', err ) );
....
....
createWindow();
.....
} )

app.whenReady ().then ( () => {
installExtension( REDUX_DEVTOOLS, {forceDownload: true, loadExtensionOptions: { allowFileAccess: true } } )
.then( ( name ) => console.log( Added Extension: ${ name } ) )
.catch( ( err ) => console.error( 'An error occurred "redux_devtools": ', err ) );
installExtension( REACT_DEVELOPER_TOOLS )
.then( ( name ) => console.log( Added Extension: ${ name } ) )
.catch( ( err ) => console.error( 'An error occurred "react_devtools": ', err ) );
} )

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

Successfully merging a pull request may close this issue.

5 participants