Skip to content

Proxy error: Could not proxy request /something from myapp.herokuapp.com to http://localhost:3001 #4145

@abagh0703

Description

@abagh0703

CLOSED
This is not an issue with Create-React-App.

Is this a bug report?

Yes

Which terms did you search for in User Guide?

I initially had an "invalid host header" issue. The README for the create-react-app suggests adding a .env.development file. I did, and I began receiving another error that prevented my Heroku App from even running. No answers I found online could help. I go into detail about that here.
Eventually I caved and added the "DANGEROUSLY_DISABLE_HOST_CHECK" in .env.development.local, and my Heroku app no longer crashed but I received a different error specified here.

Environment

  1. node -v: 6.11.3
  2. npm -v: 5.7.1
  3. yarn --version (if you use Yarn):
  4. npm ls react-scripts (if you haven’t ejected): 1.0.17

Then, specify:

  1. Operating system: Windows 10
  2. Browser and version (if relevant): Cross-Browser, but console error messages are from Firefox 58.0.2

Steps to Reproduce

  1. Clone https://github.com/abagh0703/cra-proxy-error (sorry about the .idea file, forgot to gitignore)
  2. heroku create (some name)
  3. heroku buildpacks:set https://github.com/heroku/heroku-buildpack-nodejs#v83 -a (the same some name)
  4. git push heroku master

Expected Behavior

The app should print "hello" in the console.

Actual Behavior

Heroku gives an error about proxying.
heroku error
Console gives this less helpful error:
console_error

Reproducible Demo

https://github.com/abagh0703/cra-proxy-error
Instructions to reproduce included in readme.
Is it just a matter of using the wrong buildpack? Forgive me if this is too specific for an issue here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions