Gitpod: React-App: "Invalid Host header"

Created on 19 Jun 2019  路  4Comments  路  Source: gitpod-io/gitpod

How to fix #26 with a React Project?

question

Most helpful comment

Hi @Funory! Thank you for reaching out.

As mentioned in https://www.gitpod.io/blog/gitpodify/#invalid-host-header, you can try several things:

  • Use the --host 0.0.0.0 --disable-host-check flags with your webpack-dev-server or ng serve CLI
  • Add devServer: { host: '0.0.0.0', disableHostCheck: true } to your webpack.config.js or vue.config.js file
  • Set the DANGEROUSLY_DISABLE_HOST_CHECK env variable to true in your project

Hope this helps!

All 4 comments

Hi @Funory! Thank you for reaching out.

As mentioned in https://www.gitpod.io/blog/gitpodify/#invalid-host-header, you can try several things:

  • Use the --host 0.0.0.0 --disable-host-check flags with your webpack-dev-server or ng serve CLI
  • Add devServer: { host: '0.0.0.0', disableHostCheck: true } to your webpack.config.js or vue.config.js file
  • Set the DANGEROUSLY_DISABLE_HOST_CHECK env variable to true in your project

Hope this helps!

Setting the DANGEROUSLY_DISABLE_HOST_CHECK=true does it, thanks.

Setting the DANGEROUSLY_DISABLE_HOST_CHECK=true does it, thanks.

Hi, where did you find that flag in react project? What source file?
Thanks.

@LuisTheDeveloper The DANGEROUSLY_DISABLE_HOST_CHECK environment variable is specific to create-react-app.

It's useful when you're using create-react-app but you have no control over what options are passed to webpack-dev-server.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hidehiro98 picture hidehiro98  路  3Comments

ColbyWTaylor picture ColbyWTaylor  路  3Comments

LezaiNiubi picture LezaiNiubi  路  3Comments

Kreyren picture Kreyren  路  3Comments

mouse484 picture mouse484  路  3Comments