Closed
Description
Describe the bug
After upgrading to version 0.20.5
(or anything greater than 0.20.2
) I get a 404 error for the hmr import GET http://localhost:3000/@/playground/vite/hmr net::ERR_ABORTED 404 (Not Found)
.
The compiled App.vue
looks like this:
import { defineComponent } from "/@modules/vue.js";
const __script = defineComponent({});
import { updateStyle } from "/@/playground/vite/hmr";
import { render as __render } from "/@/playground/App.vue?type=template";
__script.render = __render;
__script.__hmrId = "/@/playground/App.vue";
__script.__file = "D:\\test\\playground\\App.vue";
export default __script;
I have the dev environment in a separate folder called playground
but the vite.config.ts
is in the root. Before the upgrade it worked fine but now it fails.
The vite.config.ts
looks like this:
import type { UserConfig } from "vite";
import { resolve } from "path";
const config: UserConfig = {
root: resolve(__dirname, "playground"),
alias: {
"/@/": __dirname
}
};
export default config;
Could the relative path from hmrClientPublicPath
be the problem here?
Reproduction
https://github.com/MarvinRudolph/vite-hmr-bug
System Info
- required
vite
version: > 0.20.2 - required Operating System: Windows 10