Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webpack 5: disableHostCheck

Tags:

webpack

im serving webpack bundle for dev with kubernetes and get the following message:

Invalid Host header

Now i want to disable this with the option disableHostCheck, but it seems in the new version of webpack this option is removed.

Is there any other possibility?

like image 402
Fabian Börner Avatar asked Mar 25 '26 07:03

Fabian Börner


1 Answers

for me (webpack-dev-server 4.6.0), solution is :

devServer: {
        historyApiFallback: true,
        disableHostCheck: true,
}

to

devServer: {
        historyApiFallback: true,
        allowedHosts: "all",
},

for the history,

from CHANGELOG

  • the disableHostCheck and allowedHosts options were removed in favor of the firewall option

from migration Guide to v4

  • The disableHostCheck option was removed in favor allowedHosts: 'all':
like image 196
Snainer Avatar answered Mar 28 '26 02:03

Snainer