Webpack 5: disableHostCheck

Viewed 7636

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?

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':
Related