vuetify-nuxt-module: Unable to run with storybook
My setup:
- Operating System:
Darwin - Node Version:
v20.5.0 - Nuxt Version:
3.9.0 - CLI Version:
3.10.0 - Nitro Version:
2.8.1 - Package Manager:
pnpm@8.10.5 - Builder:
- - User Config:
modules,i18n,devtools - Runtime Modules:
@nuxtjs/i18n@8.0.0,vuetify-nuxt-module@0.8.0 - Build Modules:
-
Reproduction
https://github.com/AndreyYolkin/storybook-vuetify-issue
Description
Thank you for your titanic work on building this module. I’ve tried to add storybook into my project, but for some reasons vuetify works in dev mode and have some problems inside storybook. Please follow the readme to get the error in reproduction.
Additional details
- There is a working example with another nuxt-vuetify module (not maintained anymore): https://github.com/storybook-vue/storybook-nuxt-starter
- I’ve also left the comment in storybook-nuxt repo https://github.com/storybook-vue/storybook-nuxt/issues/42#issuecomment-1877067150
About this issue
- Original URL
- State: open
- Created 6 months ago
- Comments: 45 (25 by maintainers)
I have released @storybook-vue/nuxt 0.2.1 with patch fixing this issue,.
if it did not work for you please create a repro repo for me. i will check it out
Will try tomorrow, not sure, because it was released even before vuetify 3.4 and nuxt 3.7.
Sorry, another timezone
Tried also using defineAsyncComponent, no luck, same error (removing
enforce: 'post'patch):I’m going to update the repo to
^7.6.7:fingers_crossed:I’ve achieved the same result rn with this:
ok, found the problem: https://github.com/storybook-vue/storybook-nuxt/blob/main/packages/storybook-nuxt/src/preset.ts#L95C26-L97
calling with raw vue file since it is moving all plugins before vue
In build:
it is being called in the build, it works, the imports are there, but storybook calling again with raw vue file:
No, it seems vuetify vite plugin missing from vite plugins.
I don’t know why
applyNuxtPluginsare called after rendering the pages, I just added a breakpoint in the nuxtjs/i18n warning, storybook should review Nuxt 3 integration logic.This module enables treeshaking feature via vuetify vite plugin (there is no way to use all components, you need to add them to
vuetify.vuetifyOptions.componentsin the nuxt configuration or vuetify config file), the deprecated nuxt module by default not enabling that feature IIRC (maybe also a problem with nuxt vuetifysequential postplugin,i18nis installed and configured in the app).