当在网页中输入地址后发现无法打开VUE项目地址:
报错Invalid Host header
解决方法:
在webpack 5 中disableHostCheck应该被遗弃了
查看文档了解到需将 disableHostCheck:true
替换为
historyApiFallback: true,
allowedHosts: “all”,
重新配置vue.config.js
devServer: {
historyApiFallback: true,
allowedHosts: “all”,
}
重新运行:npm run serve 就可以打开了
标签:vue,50,Invalid,allowedHosts,header,Host,true From: https://www.cnblogs.com/mxx520/p/17107278.html