Closed Kotoriii closed 2 years ago
The problem was the vue() plugin
Glad you found the problem!
@Kotoriii I'm stuck with the same problem, please share how you fixed it? :-)
@olemarius you're just not having any luck, are you? :(
@IanVS haha yea been struggling with getting things to work for a while now. At least I got it to work in a test repo, but getting it to work in a pretty complex set up saas application is a bit more tricky. But at least storybook starts now, only thing missing is the components actually being rendered.
@IanVS finally got it working! Here's the repo.
https://github.com/olemarius/storybook-builder-vite-example-vue-in-isolation
Edit: Oops, made it Private first. Changed to Public now.
The error occurs when @vitejs/plugin-vue is added. I was importing my vite.config.ts file where I need the vue() plugin, but when I handled vite's config seperately in main.js it worked.
I also added some plugins and alias that I use in my project to make sure it work.
async viteFinal(config) {
config.resolve.alias['@'] = resolve(__dirname, '../src');
config.plugins.push(WindiCSS());
Icons({
scale: 1,
compiler: 'vue3',
autoInstall: true
});
Components({
dts: true,
dirs: [
'src/components',
'src/pages/Orienteering/components'
],
deep: true,
resolvers: IconsResolver({
componentPrefix: 'icon'
}),
});
config.plugins.push(
vueI18n({
runtimeOnly: false,
include: [
resolve(__dirname, './src/locales/**'),
]
})
);
// enabling this will cause 'Component is missing template or render function' error
// config.plugins.push(vue())
return config;
},
I have a fresh
"@storybook/vue3": "6.4.0-beta.25"
installation, where I removed the examples and tried adding an extremely basic story. The story appears in the sidebar, but the component is not rendering, and I get the following warning:link.stories.js
Link.vue
main.js
vite.config.js
Any ideas?