unplugin / unplugin-vue-components

📲 On-demand components auto importing for Vue

Home Page:https://www.npmjs.com/package/unplugin-vue-components

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

cjholowatyj opened this issue · comments

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

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.