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

Does not work in a proxified environment #2832

Closed
Lodin opened this issue Jul 21, 2017 · 4 comments
Closed

Does not work in a proxified environment #2832

Lodin opened this issue Jul 21, 2017 · 4 comments
Milestone

Comments

@Lodin
Copy link

Lodin commented Jul 21, 2017

Is this a bug report?

Yes.

I'm trying to initialize a project with create-react-app in an environment, where all connections go through the proxy. To make yarn work I have to execute yarn config set proxy <...> and yarn config set http-proxy <...>. npm requires the same actions as well. When I try to install a package with yarn, everyting works well.

However, create-react-app complains that "You appear to be offline" and fails due to emptiness of yarn local cache. I assume it is connected with proxy, and the create-react-app checking for online connection fails because of proxy.

Is there a workaround for this problem? Can I just disable this checking completely?

Can you also reproduce the problem with npm 4.x?

I haven't tried it, but I guess yes.

Which terms did you search for in User Guide?

There is no answer for this question

Environment

  1. node -v: 8.1.2
  2. npm -v: 5.0.3
  3. yarn --version: 0.27.5

Then, specify:

  1. Operating system: Windows 7

Steps to Reproduce

  1. Enable a proxy applied to all internet connections (Unfortunately, I don't know details, I just work on this system)
  2. Make sure your local yarn config is empty.
  3. Execute yarn config set proxy <your proxy here> and yarn config set http-proxy <your proxy here>
  4. Try create-react-app <your project name>. It should display: "You appear to be offline".

Expected Behavior

It should detect connection with proxy correctly

or

I should be able to disable checking manually, e.g. with a key --no-offline-mode

Actual Behavior

create-react-app complains: "You appear to be offline" and fails due to emptiness of yarn local cache.

@Timer Timer added this to the 100.0.0 milestone Jul 25, 2017
@Timer
Copy link
Contributor

Timer commented Jul 25, 2017

We've never seen this before as I assume it's a pretty rare occurrence; we'd welcome a PR to correct this behavior: https://github.com/facebookincubator/create-react-app/blob/master/packages/create-react-app/createReactApp.js#L616.

@mattwoodco
Copy link

I'm running into the same issue. I am also required to connect via a proxy, and I continue to get the "You appear to be offline" error.

I don't have enough experience with node to suggest a PR with an alternative to this dns.lookup() when using a proxy.

However, @Lodin, a temporary fix is to comment out the dns.lookup highlighted by @Timer above, and simply force the checkIfOnline() to return true.

bsyk added a commit to bsyk/create-react-app that referenced this issue Aug 2, 2017
If the environment variable `https_proxy` is set, test that the proxy name is resolveable rather than 'registry.yarnpkg.com'.
This fixes facebook#2832.
@herzaso
Copy link

herzaso commented Aug 3, 2017

I have the same problem. @bsyk solution seems to work although warnings are still emitted:

There appears to be trouble with your network connection. Retrying...

@Timer Timer closed this as completed in d009a99 Aug 9, 2017
JohnNilsson referenced this issue in JohnNilsson/create-react-app-typescript Aug 9, 2017
…(#2884)

* Adjust the `checkIfOnline` check if in a corporate proxy environment
If the environment variable `https_proxy` is set, test that the proxy name is resolveable rather than 'registry.yarnpkg.com'.
This fixes #2832.

* Adjust to check yarnpkg.com first, then check the proxy address only if that failed
JohnNilsson referenced this issue in JohnNilsson/create-react-app-typescript Sep 9, 2017
…(#2884)

* Adjust the `checkIfOnline` check if in a corporate proxy environment
If the environment variable `https_proxy` is set, test that the proxy name is resolveable rather than 'registry.yarnpkg.com'.
This fixes #2832.

* Adjust to check yarnpkg.com first, then check the proxy address only if that failed
kasperpeulen pushed a commit to kasperpeulen/create-react-app that referenced this issue Sep 24, 2017
…acebook#2884)

* Adjust the `checkIfOnline` check if in a corporate proxy environment
If the environment variable `https_proxy` is set, test that the proxy name is resolveable rather than 'registry.yarnpkg.com'.
This fixes facebook#2832.

* Adjust to check yarnpkg.com first, then check the proxy address only if that failed
swengorschewski referenced this issue in swengorschewski/cra-typescript-electron Oct 16, 2017
…(#2884)

* Adjust the `checkIfOnline` check if in a corporate proxy environment
If the environment variable `https_proxy` is set, test that the proxy name is resolveable rather than 'registry.yarnpkg.com'.
This fixes #2832.

* Adjust to check yarnpkg.com first, then check the proxy address only if that failed
@eniniz
Copy link

eniniz commented Nov 24, 2017

+1

@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants