Open melodyogonna opened 1 year ago
Hello,
I success to fix it, add to your .storybook/main.ts
the snippet below:
import type {StorybookConfig} from "@storybook-vue/nuxt";
import {ViteConfig} from "@nuxt/schema";
const config: StorybookConfig = {
stories: [
"../stories/**/*.mdx",
"../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)",
],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
],
framework: {
name: "@storybook-vue/nuxt",
options: {},
},
docs: {
autodocs: "tag",
},
// Should fix your problem
viteFinal(config: ViteConfig) {
const vuetifyImport = config.plugins!.find(({name}) => name === 'vuetify:import')
config.plugins = [...config.plugins!.filter(({name}) => name !== 'vuetify:import'), vuetifyImport];
return config;
}
};
export default config;
It is not a very sexy solution, but it's works for me. I just change the position of the plugin.
Use the last version of the plugin here you will find all the versions: https://stackblitz.com/~/github.com/storybook-vue/storybook-nuxt/pull/49
It is not a very sexy solution, but it's works for me. I just change the position of the plugin
Yes this should be done by Vuetify plugin, normalement nuxt handle this case by unshifting the vuePlugin and vueJSX plugin, i don't know why this is happening.
here I'm using Vuetify module from @invictus.codes/nuxt-vuetify
works just fine https://github.com/storybook-vue/storybook-nuxt-starter https://github.com/storybook-vue/storybook-nuxt-starter
Environment:
Darwin
v20.3.1
3.6.5
2.5.2
npm@9.6.7
vite
css
,app
,build
,modules
,runtimeConfig
,typescript
,hooks
@pinia/nuxt@0.4.11
,@nuxt/content@2.7.2
-
Issue: I'm encountering a problem while trying to load vite-plugin-vuetify, to enable treeshaking in vuetify.
Relevant Nuxt Config section:
If it helps, here is the error source, I have not been able to find whether I can manually set this vite-vue-plugin myself, it seems to me like nuxi loads it but Storybooks doesn't.