Replies: 1 comment
-
我已经提了一个pr合并进去了,现在这个问题已经解决了 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
当第一次运行yarn serve 或 yarn dev时,可以正常运行项目。 但是当热更新保存项目内任意文件时, 会提示如标题所示的错误。
代码里这部分内容似乎存在issue:
vite.config.ts:
server: {
// Listening on all local IPs
host: true,
port: VITE_PORT,
// Load proxy configuration from .env
proxy: createProxy(VITE_PROXY),
},
build/vite/proxy.ts:
/**
*/
export function createProxy(list: ProxyList = []) {
const ret: ProxyTargetList = {};
for (const [prefix, target] of list) {
console.log('prefex', prefix);
console.log('target', target);
const isHttps = httpsRE.test(target);
// https://github.com/http-party/node-http-proxy#options
ret[prefix] = {
target: target,
changeOrigin: true,
ws: true,
rewrite: (path) => path.replace(new RegExp(
^${prefix}
), ''),// https is require secure=false
...(isHttps ? { secure: false } : {}),
};
}
return ret;
}
请问如何解决以上问题
Beta Was this translation helpful? Give feedback.
All reactions