(解决)WebSocket connection to ‘ws://lockhost:8088/ws‘ failed: Invalid frame header
解决vue项目控制台不停ws报错
·
主要是ws: false
//vue.config.js
const { defineConfig } = require('@vue/cli-service')
const port = process.env.port || '8088'
const target = process.env.VUE_APP_SERVER_URL
console.error('-----------')
console.log(target)
module.exports = defineConfig({
transpileDependencies: true,
lintOnSave: false,
outputDir: process.env.outputDir,
devServer: {
// host: '0.0.0.0',
host: 'localhost',
open: true,
port: port,
// 代理
proxy: {
'/': {
target: target,
changeOrigin: true,
pathRewrite: {
'^/': '/'
},
ws: false
}
}
}
})
更多推荐
已为社区贡献4条内容
所有评论(0)