Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vuetify+nuxt+vue-macros combination of components has stopped working #275

Open
AndreyKindin opened this issue Sep 11, 2024 · 6 comments
Open

Comments

@AndreyKindin
Copy link

Hello,
recently, the combination of vuetify+nuxt(-module)+vue-macros stopped working.
If I remove Vue macros from the module, it seems to work. I'm not sure if I'm in the right place with the bug, but maybe just as a heads up that the bug exists.
Here is the Stackblitz for it:
https://stackblitz.com/edit/nuxt-starter-5xyynj?file=nuxt.config.ts

P.S.:
If I try to implement the whole thing without the vuetify-nuxt-module, but rather via the plugin, I get the error:
Cannot start nuxt: Vuetify plugin must be loaded after the vue plugin

at configResolved (node_modules/vite-plugin-vuetify/dist/index.cjs:29:15)
at node_modules/vite/dist/node/chunks/dep-BaOMuo4I.js:66327:67
at Array.map ()
at resolveConfig (node_modules/vite/dist/node/chunks/dep-BaOMuo4I.js:66327:53)
at async _createServer (node_modules/vite/dist/node/chunks/dep-BaOMuo4I.js:62687:18)
at async buildClient (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.CMaRZVaO.mjs:745:24)
at async withLogs (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.CMaRZVaO.mjs:1835:3)
at async bundle (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.CMaRZVaO.mjs:1826:3)
at async bundle (node_modules/nuxt/dist/index.mjs:5888:5)
at async build (node_modules/nuxt/dist/index.mjs:5763:3)

@userquin
Copy link
Member

looks like something wrong in @vue-macros/nuxt, I'm going to try to fix it

@userquin
Copy link
Member

@vue-macros/nuxt removing vite:vue plugin https://github.com/vue-macros/vue-macros/blob/main/packages/nuxt/src/index.ts#L41-L42, I'll send you a module to fix the problem and maybe detect @vue-macros/nuxt module here to move the internal plugins.

@userquin
Copy link
Member

userquin commented Sep 11, 2024

@AndreyKindin check my comment on vue macros issue (asked Kevin Deng about posible fix)

@userquin
Copy link
Member

userquin commented Sep 11, 2024

@AndreyKindin check https://stackblitz.com/edit/nuxt-starter-jq6cno?file=nuxt.config.ts,app.vue,package.json,.nuxt%2Fcomponents.d.ts again

It is using the pkg-pr-new from this PR #276 and it is working since there is no dependency on vite:vue plugin (position) => moved to Nuxt component loader

I need to add directive auto import to Nuxt and we can remove custom Vuetify Vite plugin here: rn only used for directives ignoring any component or lab component auto import

@sxzz
Copy link

sxzz commented Sep 12, 2024

The reason is that Vue Macros will remove vite:vue plugin from the original plugin list and add it back into an array.

before: [a, 'vite:vue', b]
after: [a, [b, 'vite:vue', c, d], e]
now: [a, b, 'vite:vue', c, d, e]

This way it won't affect other plugins. Successfully fixed at https://stackblitz.com/edit/nuxt-starter-itabzd.

@userquin
Copy link
Member

thx @sxzz ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants