unplugin-vue-components
unplugin-vue-components copied to clipboard
Components are unresolved in production build after upgrading to Vite 3+
Describe the bug
After upgrading Vite to 3+ version, component loading is not working any more in production mode (component tags are unresolved in produced output and auto-loaded components are missing from dist files). Everything is working in dev build.
Expected output (from dev build):
Actual output (from production build):
Can be reproduced using vite-vue3 example:
yarn build
yarn vite preview
Reproduction
https://github.com/antfu/unplugin-vue-components/tree/cb8f9325ffdaeb74927d823095a30d2ec9a262a9/examples/vite-vue3
System Info
System:
OS: Windows 10 10.0.19044
CPU: (12) x64 11th Gen Intel(R) Core(TM) i5-11500H @ 2.90GHz
Memory: 10.82 GB / 31.73 GB
Binaries:
Node: 18.8.0 - ~\scoop\apps\nodejs\current\node.EXE
Yarn: 1.22.19 - ~\scoop\apps\nodejs\current\bin\yarn.CMD
npm: 8.18.0 - ~\scoop\apps\nodejs\current\npm.CMD
Browsers:
Edge: Spartan (44.19041.1266.0), Chromium (104.0.1293.70)
Internet Explorer: 11.0.19041.1566
Used Package Manager
yarn
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guide.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- [X] The provided reproduction is a minimal reproducible of the bug.
I have also encountered this problem, and I hope it can be solved
MacOs 12,vite 3.0.2,unplugin-vue-components 0.22.4,vue 3.2.37
how to deal with it.....
how to deal with it.....
components introduced in markdown files are not parsed
how to deal with it.....
At the moment the best workaround is probably to downgrade to vite 2.x
how to deal with it.....
At the moment the best workaround is probably to downgrade to vite 2.x
Some plugins or frameworks are built on 3.x, and we can't downgrade them
me too
I have also encountered this problem.