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.

Can't remote develop create-react-app due to "Invalid Host Header"

See original GitHub issue

At work I do all my development shelled into an AWS instance. This means my code and dev server are both remote, but my browser is local. When I try to access my react app, I get “Invalid Host Header”. I think this is due to the fix for webpack/webpack-dev-server#887. From googling around, it looks like I can fix this by ejecting, but that’s supposed to be for power users and the reason I’m trying create-react-app in the first place is I don’t understand anything about the ecoystem yet.

Is there anything I can do about this aside from ejecting? Is this worth fixing somehow?

Someone asked a question about this on Stack Overflow but didn’t get a response.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:8
  • Comments:30 (9 by maintainers)

github_iconTop GitHub Comments

39reactions
gaearoncommented, May 19, 2017

Can you put your HOST into .env file?

HOST=mydevserver.com

Then restart the development server.

10reactions
gaearoncommented, May 20, 2017

Please update to react-scripts@1.0.2.
It fixes this issue for users who don’t use the proxy feature.

If you do use the proxy feature, please follow these instructions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid Host header when running Create React App on ...
An easy solution for development environment would be to set the following environment variable: DANGEROUSLY_DISABLE_HOST_CHECK=true.
Read more >
Webpack Dev Server External Access - (Fix: Invalid Host ...
While developing a React web app in local development mode, you may want to run the dev mode on mobile or quickly share...
Read more >
“Invalid Host Header” Errors when running your React project ...
So your react app is hosted on localhost:3000 and your node backend is on localhost:3001. This isn't a problem if you a developing...
Read more >
DilwoarH/G-Cloud-Chat-Bot - Buttons - Heroku Elements
Builds the app for production to the build folder. It correctly bundles React in production mode and optimizes the build for the best...
Read more >
webpack Invalid Host header when accessing from domain ...
If you are trying to recreate what create-react-app is doing on your own, following the HOST header in their open source code, you...
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