Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite > v0.20.2: Can't find /@/playground/vite/hmr #357

Closed
m4rvr opened this issue Jun 6, 2020 · 0 comments
Closed

Vite > v0.20.2: Can't find /@/playground/vite/hmr #357

m4rvr opened this issue Jun 6, 2020 · 0 comments

Comments

@m4rvr
Copy link
Contributor

m4rvr commented Jun 6, 2020

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
@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant