Open productdevbook opened 2 years ago
Experiencing the same issue with Nuxt 3.
Hi, I'm not very familiar with vue3 auto imports, or what the issue here is. Can someone please explain the problem, how it's supposed to work, and what's happening instead?
Hi, I'm not very familiar with vue3 auto imports, or what the issue here is. Can someone please explain the problem, how it's supposed to work, and what's happening instead?
we used, and add settings storybook settings. https://github.com/antfu/unplugin-auto-import https://github.com/antfu/unplugin-vue-components
Experiencing the same issue with Nuxt 3.
I use them both and have no issues with latest storybook vue 3 vite config. Maybe try adding separate vite.config.ts
inside .storybook
folder instead of using viteFinal
property? It loads in the config automatically.
Also, alternatively you might have an issue with path of components as they point to components inside .storybook
config.plugins.push(Components({
dirs: ['components'],
directoryAsNamespace: true,
dts: '.storybook/components.d.ts',
}))
So this:
dirs: ['components'],
Can be changed to
dirs: ['../src/components'],
Or wherever you keep the components.
You can also try adding
...
AutoImport({
...
dirs: [
'./src/components',
],
vueTemplate: true,
...
}),
...
in your vite config.
Let me know if any of these solutions work.
It loads in the config automatically.
Note, this is only true in Storybook 7.0.