unplugin / unplugin-vue-components

📲 On-demand components auto importing for Vue
https://www.npmjs.com/package/unplugin-vue-components
MIT License
3.77k stars 349 forks source link

Using `unplugin-vue-components` with Vite/InertiaSSR/etc? #726

Open cjholowatyj opened 8 months ago

cjholowatyj commented 8 months ago

Describe the bug

I'm trying to get unplugin-vue-components working in my project, but I'm getting problems with picomatch (a dependency of @rollup/pluginutils@5.1.0, which is a dependency of unplugin-vue-components) where it's trying to access process, which is clearly incompatible with Vite & Inertia SSR, which use import.meta. I really want to be able to use this package successfully in my project (because it appears to pair so nicely with unplugin-vue-markdown) but I'm not sure how to resolve an issue with a nested dependency. I'm also seeing that it is looking for extname at build time as well, which seems to be failing...

Chrome DevTools console looks like...

Screenshot_2024-01-11_at_9 10 43_PM

Vite Build error looks like...

Screenshot 2024-01-12 at 3 47 31 PM

Reproduction

https://gist.github.com/cjholowatyj/2b6a524f9777209f5872708028d92111

System Info

**My Dev Stack:** `Laravel 10`/`InertiaJS 1`/`VueJS 3`/`ViteJS 4`/`TailwindCSS 3`/`Vitest 0.31`/`VitePress 1`/`Typescript`/`SSR`/`FontAwesome Pro 6`/`Ploi.io`/`Qodana`/`Cypress`/`ImgIX`/`HubSpot`/`SendGrid`/`SignEasy`/`Stripe`

Used Package Manager

pnpm

Validations