Vite HMR Not Working When Using a Library That Depends on @vueusecore - Stack Overflow

In my Vite + Vue3 project, HMR works fine in the local development environment. However, when I import

In my Vite + Vue3 project, HMR works fine in the local development environment. However, when I import a third-party library that depends on @vueuse/core, HMR stops working.

After debugging, I found that:

  • If I comment out the third-party library, HMR works normally.
  • If I import my own library (which I developed), HMR also stops working.
  • If I remove @vueuse/core from my library’s dependencies, HMR works again.

I suspect this might be due to different versions of Vue core dependencies between my project and @vueuse/core.

Steps to Reproduce

  1. Create a Vite + Vue3 project.
  2. List item Install and import a library that depends on @vueuse/core.
  3. Observe that HMR no longer works.
  4. Remove @vueuse/core from the library’s dependencies and see that HMR works again.

Environment

  • Vite: 4.4.9
  • Vue: 3.3.4
  • @vueuse/core: 12.7.0

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745107173a4611628.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信