use import.meta.hot in a vitepress plugin
See original GitHub issueDescribe the bug
Trying to implement client server communication in a vite-plugin I’m receiving Property ‘hot’ does not exist on type ‘ImportMeta’ just like in #416.
Try to import vite/hmr but it is not exported but importing vite/client fix it (at least volar and build stop complaining…)
but when I run client I got an error in the import line
https://github.com/emersonbottero/vitepress-plugin-search/blob/flexsearch/src/Search.vue#L4
GET http://localhost:5173/@fs/C:/Users/emers/Source/Repos/vitepress-plugin-search/dist/Search.vue net::ERR_ABORTED 500 (Internal Server Error)
P.S.: I’m trying to improve the vitepress-plugin-search so it is easy to provide options to the builder and search. in the current version is hard to add languages for example
Reproduction
press . on my repository within the browser 😁
Steps to reproduce
pnpm i pnpm build cd demo pnpm i pnpm dev
System Info
System:
OS: Windows 10 10.0.22621
CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Memory: 6.20 GB / 15.92 GB
Binaries: Node: 16.18.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.5 - ~\AppData\Roaming\npm\yarn.CMD npm: 8.1.3 - ~\AppData\Roaming\npm\npm.CMD
Browsers:
Chrome: 106.0.5249.119
Edge: Spartan (44.22621.746.0), Chromium (106.0.1370.42)
Internet Explorer: 11.0.22621.1
Used Package Manager
pnpm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it’s a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
I don’t think so. Feel free to take it!
is anyone working on this ? @emersonbottero @bluwy