The npm run dev preview of the Vite project failed #6888
我是第一次在code-server中开发前端项目,为什么会预览失败呢?[我的相关安全组端口全是打开的] |
Answered by
code-asher
Jul 10, 2024
Replies: 1 comment 1 reply
|
Your application needs to be configured to prepend the proxy path to its requests ( You might also have to use If you can, use the subdomain proxy instead. It avoids these types of issues. |
1 reply
Answer selected by
sanbei101
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Your application needs to be configured to prepend the proxy path to its requests (
/proxy/5173/in your case) or it needs to make the requests relatively. Currently it is making requests against the root, which is not right.You might also have to use
/absproxy/5173instead, depending on how the application is configured. I am not familiar enough with Vite to say, but you can read #4541 (comment)If you can, use the subdomain proxy instead. It avoids these types of issues.