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

Unable to install react-developer-tools (unzip exits with code 9 "not found" due to HTTP-204 trying to download the crx) #157

Open
nonchip opened this issue Sep 27, 2020 · 4 comments

Comments

@nonchip
Copy link

nonchip commented Sep 27, 2020

code (from electron-react-boilerplate):

  const installer = require('electron-devtools-installer');
  const extensions = ['REACT_DEVELOPER_TOOLS', 'REDUX_DEVTOOLS'];
// ... (some promise/catch/await magic) ...
  extensions.map((name) => installer.default(installer[name], forceDownload))

output:

Error: Exited with code 9
    at ChildProcess.<anonymous> (/home/kyra/dev/worst_story_engine/node_modules/cross-unzip/index.js:40:21)
    at ChildProcess.emit (events.js:210:5)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)

according to man unzip, code 9 is:

the specified zipfiles were not found.

patched some logging into cross-unzip by hand, it's trying to run:

unzip -o ~/.config/Electron/extensions/fmkadmapgofadopljbjfkapdkoienihi.crx -d ~/.config/Electron/extensions/fmkadmapgofadopljbjfkapdkoienihi

looked at that file:

$ file ~/.config/Electron/extensions/fmkadmapgofadopljbjfkapdkoienihi.crx
~/.config/Electron/extensions/fmkadmapgofadopljbjfkapdkoienihi.crx: empty

tried to manually remove it, exact same issue again.
looks like somehow instead of e.g. 404ing or similar, the chrome servers just give you an empty file (or you somehow manage to drop the content instead of saving it, but i doubt that, utils.downloadFile looks sane), thus not triggering your Failed to fetch error.


Update:

peeled the url out of your code, curled it manually to see:

$ curl -v https://clients2.google.com/service/update2/crx\?response\=redirect\&x\=id%3Dfmkadmapgofadopljbjfkapdkoienihi%26uc\&prodversion\=32

[omitting lots of ssl/connection stuff here that's unrelated]

* Connected to clients2.google.com (172.217.18.110) port 443 (#0)
* Using HTTP2, server supports multi-use
> GET /service/update2/crx?response=redirect&x=id%3Dfmkadmapgofadopljbjfkapdkoienihi%26uc&prodversion=32 HTTP/2
> Host: clients2.google.com
> user-agent: curl/7.72.0
> accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
< HTTP/2 204
< content-security-policy: script-src 'report-sample' 'nonce-VQkaHQUCKKGpu5OepZ/IVg' 'unsafe-inline' 'strict-dynamic' https: http:;object-src 'none';base-uri 'self';report-uri https://csp.withgoogle.com/csp/clientupdate-aus/1
< cache-control: no-cache, no-store, max-age=0, must-revalidate
< pragma: no-cache
< expires: Mon, 01 Jan 1990 00:00:00 GMT
< date: Sun, 27 Sep 2020 08:36:37 GMT
< server: GSE
< alt-svc: h3-Q050=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-27=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
<
* Connection #0 to host clients2.google.com left intact

so yeah, getting a nice HTTP/2 204 (no content) with empty response, which you're not catching in downloadFile, if i had to take a wild guess i'd say google changed the URL and/or extension id (though https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi still seems valid).

note it actually did install the redux tools, so it just seems to be something about the react-devtools that's wrong

@nonchip nonchip changed the title Unable to install (unzip exits with code 9 "not found") Unable to install (unzip exits with code 9 "not found" due to HTTP-204 trying to download the crx) Sep 27, 2020
@nonchip nonchip changed the title Unable to install (unzip exits with code 9 "not found" due to HTTP-204 trying to download the crx) Unable to install react-developer-tools (unzip exits with code 9 "not found" due to HTTP-204 trying to download the crx) Sep 27, 2020
@agungsb
Copy link

agungsb commented Oct 6, 2020

I also experience this. Probably the culprit is cross-zip package. It's only a wild guess though. Need to check and confirm.

@agungsb
Copy link

agungsb commented Oct 6, 2020

I ended up using https://www.electronjs.org/docs/api/session#sesloadextensionpath and it worked fine. Great package anyway 👍

@esiegel
Copy link

esiegel commented Oct 7, 2020

I believe you just need to upgrade to version 3.1.1 which suppports crx version 3 downloads. It was fixed here: #140

@andyfaizan
Copy link

@esiegel Thanks! Update to 3.1.1 fixed the issue for me.

barmac added a commit to camunda/camunda-modeler that referenced this issue Feb 5, 2021
This fixes the devtools extension after a breaking
change in Chrome Web Store API.

Related to MarshallOfSound/electron-devtools-installer#157 (comment)
barmac added a commit to camunda/camunda-modeler that referenced this issue Feb 8, 2021
This fixes the devtools extension after a breaking
change in Chrome Web Store API.

Related to MarshallOfSound/electron-devtools-installer#157 (comment)
Aaron-Bird added a commit to Aaron-Bird/BoostNote-Legacy that referenced this issue Jun 30, 2022
2 Fix: Unable to install chrome extension by upgrading electron-devtools-installer to version 3.2.0 (MarshallOfSound/electron-devtools-installer#157)
3 Fix: Remove REACT_PERF (MarshallOfSound/electron-devtools-installer#167)
4 Fix: Replaced 'import redux-devtools' with chrome extension Redux DevTools
5 Fix: Cannot automatically format URL when pasting URL after code block
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

4 participants