Profer
Profer

Reputation: 643

Invalid host error issue in webpack config file?

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

Upvotes: 0

Views: 1424

Answers (1)

Ashok
Ashok

Reputation: 2932

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.

Upvotes: 1

Related Questions