vuejs / core

πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
https://vuejs.org/
MIT License
47.8k stars 8.35k forks source link

hmr not work when i use vite library build js and use it in vue #12344

Closed chenendian closed 2 weeks ago

chenendian commented 2 weeks ago

Vue version

3.4.37

Link to minimal reproduction

https://stackblitz.com/~/github.com/chenendian/vitejs-vite-gjvzny?file=src/App.vue

Steps to reproduce

yarn dev

What is expected?

edit template div txt hmr update borwer

What is actually happening?

hmr not work

System Info

No response

Any additional comments?

No response

edison1105 commented 2 weeks ago

image Please check your minimal reproduction link.

chenendian commented 2 weeks ago

图像 θ―·ζ£€ζŸ₯ζ‚¨ηš„ζœ€ε°ε€εˆΆι“ΎζŽ₯。

now this link is accessible.

edison1105 commented 2 weeks ago

import TestHmr from ../dist/index.es.js is overriding window.__VUE_HMR_RUNTIME__ from Vue.js, which is causing HMR to fail.

chenendian commented 2 weeks ago

this poblem is resolved use this fucntion this is lin https://github.com/vitejs/vite/issues/11730