Skip to content

Proxy not working #709

Closed
Closed

Description

@ShinyChang

Expected behavior

fetch() should work correctly.

Actual behavior

I got 404 NOT FOUND.

Environment

create-react-app: v0.4.3
React-scripts: v0.4.3
Node: v4.4.7
npm: v3.8.3

Operating system:
Windows

image

Activity

  1. gaearon commented on Sep 23, 2016

    @gaearon
    Contributor

    Have you restarted the development server after adding the proxy setting?

  2. ShinyChang commented on Sep 23, 2016

    @ShinyChang
    Author

    @gaearon yes, i did.

  3. ShinyChang commented on Sep 23, 2016

    @ShinyChang
    Author

    is there any way to checking proxy server?

  4. gaearon commented on Sep 23, 2016

    @gaearon
    Contributor

    Can you publish both projects so I could take a look? Meaning both generated project and the server you are using.

    Also, can you reproduce this with https://github.com/fullstackreact/food-lookup-demo?

  5. ShinyChang commented on Sep 23, 2016

    @ShinyChang
    Author
  6. gaearon commented on Sep 23, 2016

    @gaearon
    Contributor

    Can’t reproduce this on OS X so far:

    screen shot 2016-09-23 at 12 44 23

    I’ll give Windows a try later today.

  7. added this to the 0.5.0 milestone on Sep 23, 2016
  8. ShinyChang commented on Sep 23, 2016

    @ShinyChang
    Author

    I restarted my computer, and it works fine now. Not sure what's happed.

  9. gaearon commented on Sep 23, 2016

    @gaearon
    Contributor

    ¯_(ツ)_/¯

  10. shime commented on Aug 31, 2017

    @shime
    Contributor

    Wow, this is interesting. Had the exact same problem and solved it by restarting a computer too. No idea what's going on here.

  11. nickredmark commented on Oct 11, 2017

    @nickredmark

    Just some info for other people landing here: for me proxy works with a simple curl request, but not when opening the url in the browser. It's the Accept text/html header.

  12. PhilTheAir commented on Dec 18, 2017

    @PhilTheAir

    @shime Could I restart your computer to solve my problem, thanks:) still struggling with this problem

  13. rikkertkoppes commented on Dec 26, 2017

    @rikkertkoppes

    @nmaro

    Just some info for other people landing here: for me proxy works with a simple curl request, but not when opening the url in the browser. It's the Accept text/html header.

    That does seem to be the problem indeed. Having the same issue. How did you solve this?

  14. amritms commented on Dec 29, 2017

    @amritms

    restarted computer but still not working..

  15. nickredmark commented on Dec 30, 2017

    @nickredmark

    @rikkertkoppes I didn't solve it - I needed to expose a REST api and calls to those routes with fetch or curl work, the only inconvenient is not being able to open them in a browser window.

  16. superjose commented on Feb 11, 2018

    @superjose

    According to this:

    The development server will only attempt to send requests without a text/html accept header to the proxy.

    Just in case...

  17. Sandersd commented on Feb 13, 2018

    @Sandersd

    For what it's worth, I was having the same issue and a restart did the trick for me as well. I did notice as my computer was shutting down, that I had still had my work server up and running on localhost:5000 (same port as my express app). I didn't get a chance to test if killing that would solve the issue without a restart but it's a possibility?

  18. miaojiuchen commented on Mar 27, 2018

    @miaojiuchen

    Same situation...I restart my mac and it works...hahaha

  19. henrisokka commented on Apr 21, 2018

    @henrisokka

    And one more happy computer restarter.

  20. ELI7VH commented on Apr 27, 2018

    @ELI7VH

    wtf. why would restarting your computer work? can somebody get to the bottom of this? Is there some kind of caching that can help?

  21. vinaysangawar commented on Sep 13, 2018

    @vinaysangawar

    Late to the party but I tried to restart servers along with the computer itself and the proxy still wasn't working (getting 404s). I just changed my server and proxy (package.json) port from 5000 to 6000, restarted the servers, and it started working. If restarts aren't working, try changing the port number. Still not sure of the root cause though...

  22. locked and limited conversation to collaborators on Jan 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions