Skip to content

Does not work in a proxified environment #2832

Description

@Lodin

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.

Activity

  1. added this to the milestone on Jul 25, 2017
  2. Timer commented on Jul 25, 2017

    @Timer
    Contributor

    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.

  3. mattwoodco commented on Jul 26, 2017

    @mattwoodco

    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.

  4. herzaso commented on Aug 3, 2017

    @herzaso

    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...

  5. added a commit that references this issue on Aug 9, 2017
    a295a9e
  6. added a commit that references this issue on Sep 24, 2017
    6ec13c3
  7. added a commit that references this issue on Oct 16, 2017
    7191714
  8. eniniz commented on Nov 24, 2017

    @eniniz

    +1

  9. locked and limited conversation to collaborators on Jan 21, 2019
  10. added a commit that references this issue on Oct 8, 2024
    ac81af7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions