Comments (8)
Hi everyone! This happens because Storybook 8 doesn't add framework-specific plugins to Vite. This is mentioned in https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#framework-specific-vite-plugins-have-to-be-explicitly-added
You can create vite.config.js
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
export default defineConfig({
plugins: [vue()],
});
or you can add the plugin in viteFinal
as mentioned by @shoeyn. The difference is that the vite.config.js
can also be used by vitest or to build a library. So viteFinal
can be used as configuration that only applies to Storybook specifically.
from storybook.
It was a fresh install for me and I couldn't find any information on the matter in the docs as I didn't think to check the migration docs for a fresh install.
So I don't know whether a note in the docs for vite stating on projects with non-standard named vite config files will require the framework specific plugins to be registered in a standard named config file or merged in the manner I specified.
from storybook.
Had similar issue with project which has a differently named vite.config.js.
Because of this it doesn't merge the configuration to include the vite vue plugin.
In the .storybook/main.js|ts you need to add:
import vue from '@vitejs/plugin-vue'
const config: StorybookConfig = {
...,
async viteFinal(config) {
// Merge custom configuration into the default config
const { mergeConfig } = await import('vite');
return mergeConfig(config, {
plugins: [vue()],
});
},
}
from storybook.
Hi, thanks for reporting this. do you have a reproduction repo you can share? If not, can you please create one via storybook.new? We prioritize bug reports that have reproduction. Thank you! 🙏
from storybook.
Here it is!
This is a Pull request with the updated Storybook v8: Archetipo95/my-nuxt-starter#95
And on main branch you can find my Nuxt starter with working Storybook v7: https://github.com/Archetipo95/my-nuxt-starter
This is the Storybook v7 deploy: https://my-nuxt-starter-storybook.netlify.app/
from storybook.
Yep I can confirm. I was just going to write the same fix @shoeyn suggested
from storybook.
Oh yeah, it should be mentioned somewhere in the docs (e.g. https://storybook.js.org/docs/get-started/vue3-vite#troubleshooting). And also for the other frameworks.
from storybook.
cc @kylegach for the docs
from storybook.
Related Issues (20)
- [Bug]: Cannot read properties of undefined (reading 'every') when using essentials addon with typescript HOT 2
- [Documentation]: IS_STORYBOOK env variable is not defined anymore HOT 1
- [Bug]: accidentally ending a title with a `/` breaks storybook HOT 2
- [Bug]: Ember with Storybook 8 doesn't work
- [Bug]: ExceedsStorageRange errors + sloooow experience with Storybook 8 + NextJS HOT 3
- [Tracking]: Save from Controls
- [Bug]: Javascript heap out of memory when doing build-storybook when using docgen: 'vue-component-meta' HOT 1
- [Bug]: react-docgen fails on match(regex) inside promise. HOT 3
- [Bug]: Source maps fail to load with "Unsupported URL scheme" HOT 2
- [Bug]: Error in component stories using Drawer component in MUI HOT 8
- [Project SfC]: Create a server channel API to edit the args of a story or to create a new story
- [Project SfC]: Create a server channel API to create new story files triggered by the manager UI
- [Project SfC]: Provide a server channel API to get a list of files on the filesystem
- [Project SfC]: Create a toolbar to save arguments for existing or new stories
- While hitting tab key from the "skip to sidebar" button the keyboard focus is landing on the entire default page.
- [Bug]: Next JS addon shows errors using compiled .js instead of original .ts HOT 2
- Automigration for adding VTA on upgrade HOT 3
- Screen reader is not announcing the selection state of the "Violations"/"Passes"/"Incomplete" tab items in Accessibility Tab.
- Unable to use `Canvas` in doc-only MDX after upgrading to Storybook 8 HOT 3
- [Bug]: AutoDocs code view tags escaped and unusable HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from storybook.