question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

create-react-app trying to get compression lib over HTTP instead of HTTPS - failing behind proxy

See original GitHub issue

Is this a bug report?

Yes

Did you try recovering your dependencies?

$ npm --version 6.1.0 $ yarn --version 1.7.0

Which terms did you search for in User Guide?

(Write your answer here if relevant.)

Environment

Environment: OS: Windows 7 Node: 10.4.0 Yarn: 1.7.0

Steps to Reproduce

  1. create-react-app failing behind our corporate proxy. Yarn seems to use HTTP rather than HTTPS to get the ‘compression’ library - my company uses ‘Forcepoint’ and it is blocking HTTP traffic to npmjs. Not sure why this one library is not being fetched via HTTPS.

Note the verbose log output from create-react-app, this happens consistently. Everything up until the compression library works as its getting fetched via HTTPS:

verbose 25.081 Request “https://registry.npmjs.org/object-copy” finished with status code 200. verbose 25.086 Performing “GET” request to “https://registry.npmjs.org/copy-descriptor”. verbose 25.243 Request “https://registry.npmjs.org/copy-descriptor” finished with status code 200. [2/4] Fetching packages… verbose 25.502 Performing “GET” request to “http://registry.npmjs.org/compression/-/compression-1.7.2.tgz”. verbose 25.554 Error: http://registry.npmjs.org/compression/-/compression-1.7.2.tgz: Invalid tar header. Maybe the tar is c orrupted or it needs to be gunzipped? at Object.module.exports.exports.decode (C:\Users\smcgill\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:77578:43) at Extract.onheader (C:\Users\smcgill\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:146111:39)

Expected Behavior

Create a new react app

Actual Behavior

Fails consistently trying to download compression library due to our website filtering infrastructure blocking HTTP traffic to npmjs

Reproducible Demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

16reactions
shleycartercommented, Jun 25, 2018

@rodoabad I was having this issue as well so I looked through the yarn issues and found issue #746. Someone had said they disabled their antivirus which solved their problem with socket hang ups. I was running Malwarebytes and upon quitting it, I no longer had this error.

2reactions
rodoabadcommented, Jun 23, 2018

I don’t think this is a create-react-app issue. More like yarn.

Read more comments on GitHub >

github_iconTop Results From Across the Web

create-react-app doesn't work with proxy - Stack Overflow
In your package.json add: "proxy": "http://localhost:3001",. Please restart both your server ( backend app ) and front-end ( Create React ...
Read more >
DevServer - webpack
If you're using dev-server through the Node.js API, the options in devServer will be ignored. Pass the options as the first parameter instead:...
Read more >
Performance Best Practices Using Express in Production
For a high-traffic website in production, the best way to put compression in place is to implement it at a reverse proxy level...
Read more >
react-app-rewired - npm
1) Install react-app-rewired · 2) Create a config-overrides.js file in the root directory · 3) 'Flip' the existing calls to react-scripts in npm ......
Read more >
Why you should use a proxy server with Create React App
There are two common approaches of setting up proxy servers in React applications developed using CRA. We have the default CRA proxy option...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found