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

Vite build vue2, vuetify resolver: RollupError: "VOption" is not exported by "node_modules/vuetify/lib/index.js" #596

Open in-live-md opened 1 year ago

in-live-md commented 1 year ago

Describe the bug

Seems the import code generated for certain Vuetify components is amiss for some reason

Error: RollupError: "VOption" is not exported by "node_modules/vuetify/lib/index.js" 10: import { VOption as __unplugin_components_8 } from 'vuetify/lib'; ^ Looking in node_modules/vuetify/lib/components there is no subdirectory for VOption

link to vite.config.ts: https://github.com/logue/vite-vue2-vuetify-ts-starter/blob/master/vite.config.ts

Steps to recreate: git clone https://github.com/logue/vite-vue2-vuetify-ts-starter.git npm i in App.vue add the following ` <v-select :items="['a','b','c']" label="Display Type" outlined dense

Select display type

`

npm run build

Reproduction

Above - it contained code

System Info

unplugin-vue-components: 0.23.0
Vue: 2.7.14
Vuetify: 2.6.14
vite: 4.1.1

Used Package Manager

npm

Validations

so1ve commented 1 year ago

try vite-plugin-vuetify

in-live-md commented 1 year ago

It only supports vuetify/vue >= 3 (I checked peer dependencies)..

Im trying to move our vue2 repo to vite to get the build faster and smaller.. im really close - just need to iron out the vuetify part

Papooch commented 3 months ago

@in-live-md Have you ever found a solution? I'm facing exactly the same issue when migrating a Vue 2 project to Vite.