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

后端 未结 10 1977
粉色の甜心
粉色の甜心 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:49

    If you have not ejected from CRA yet, you can't easily modify your webpack config. The config file is hidden in node_modules/react_scripts/config/webpackDevServer.config.js. You are discouraged to change that config.

    Instead, you can just set the environment variable DANGEROUSLY_DISABLE_HOST_CHECK to true to disable the host check:

    DANGEROUSLY_DISABLE_HOST_CHECK=true yarn start  
    # or the equivalent npm command
    

提交回复
热议问题