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

Profer
  • 553
  • 8
  • 40
  • 81
  • You need to add devServer property like you write modules or entry in webpackConfig – Shubham Khatri Jan 16 '19 at 10:16
  • @ShubhamKhatri Please help me with some code. I never went through webpack configuration before. And please see the **Edit** part. – Profer Jan 16 '19 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...). – T.J. Crowder Jan 16 '19 at 10:37

1 Answers1

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.

Ashok
  • 2,846
  • 1
  • 12
  • 20