0

I am getting Invalid Host header after installing the node_modules in my project. Then I googled it and found this. But don't where I need to add this line in webpack.config.js.

devServer: {
  compress: true,
  public: 'store-client-nestroia1.c9users.io' // That solved it
}

Can some one please help me to do the same.

Edit 1: I have added it in webpack.config.dev.js but still no luck

Thank you!!!

3
  • You need to add devServer property like you write modules or entry in webpackConfig Commented Jan 16, 2019 at 10:16
  • @ShubhamKhatri Please help me with some code. I never went through webpack configuration before. And please see the Edit part. Commented Jan 16, 2019 at 10:18
  • Re your ping to me on this: I'm afraid Webpack config isn't something I've gotten into. But it will help people who have help you if you post your webpack.config.dev.js (and confirm that Webpack is set to use that rather than webpack.config.js? I just note the difference in names...). Commented Jan 16, 2019 at 10:37

1 Answer 1

1

Invalid Host header come becuse of a configuration error in webpack configuration.

So just use react-scripts to run project and undo your webpack configuration.

If you did your webpack configuration setup using

$ npm run eject / yarn run eject

just undo 'npm run eject / yarn run eject' from react project.

It worked for Me. May be helpful for you.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.