I am getting an “Invalid Host header” message when connecting to webpack-dev-server remotely

后端 未结 10 1975
粉色の甜心
粉色の甜心 2020-12-02 04:57

I am using as an environment, a Cloud9.io ubuntu VM Online IDE and I have reduced by troubleshooting this error to just running the app with Webpack dev server.

I l

10条回答
  •  攒了一身酷
    2020-12-02 05:37

    This is what worked for me:

    Add allowedHosts under devServer in your webpack.config.js:

    devServer: {
      compress: true,
      inline: true,
      port: '8080',
      allowedHosts: [
          '.amazonaws.com'
      ]
    },
    

    I did not need to use the --host or --public params.

提交回复
热议问题