The npm run dev preview of the Vite project failed #6888
-
我是第一次在code-server中开发前端项目,为什么会预览失败呢?[我的相关安全组端口全是打开的] |
Beta Was this translation helpful? Give feedback.
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. |
Beta Was this translation helpful? Give feedback.
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/5173
instead, 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.