nuxt-modules / storybook

Storybook integration with Nuxt.
https://storybook.nuxtjs.org
401 stars 91 forks source link

Context conflict #759

Closed bekjon-me closed 3 weeks ago

bekjon-me commented 3 weeks ago

image

When I have more than one story, I have this error. The last one is shown only. Even here on your website https://storybook.nuxtjs.org/examples/basic.

If you create a new story, you will get this error. The problem is that the storybook creates a new instance for every story. Nuxt closes an old instance when a new one is created. This is why only the last story is shown.

Here is my package.json

{
  "name": "nuxt-app",
  "type": "module",
  "private": true,
  "scripts": {
    "build": "nuxt build",
    "dev": "nuxt dev",
    "generate": "nuxt generate",
    "preview": "nuxt preview",
    "postinstall": "nuxt prepare"
  },
  "dependencies": {
    "@chromatic-com/storybook": "^1.7.0",
    "@nuxtjs/storybook": "^8.2.0",
    "class-variance-authority": "^0.7.0",
    "clsx": "^2.1.1",
    "lucide-vue-next": "^0.428.0",
    "nuxt": "^3.12.4",
    "radix-vue": "^1.9.4",
    "shadcn-nuxt": "^0.10.4",
    "tailwind-merge": "^2.5.2",
    "tailwindcss-animate": "^1.0.7",
    "vue": "latest"
  },
  "devDependencies": {
    "@antfu/eslint-config": "^2.26.0",
    "@nuxtjs/tailwindcss": "^6.12.1",
    "@storybook-vue/nuxt": "^8.2.0",
    "@storybook/addon-essentials": "^8.2.7",
    "@storybook/addon-interactions": "^8.2.7",
    "@storybook/addon-links": "^8.2.7",
    "@storybook/addon-onboarding": "^8.2.7",
    "@storybook/addon-themes": "^8.2.7",
    "@storybook/addons": "^7.6.17",
    "@storybook/test": "^8.2.7",
    "@storybook/theming": "^8.2.7",
    "@storybook/vue3": "^8.2.7",
    "@storybook/vue3-vite": "^8.2.9",
    "eslint": "^9.9.0",
    "storybook-addon-vue-slots": "^0.9.29",
    "typescript": "^5.5.4"
  }
}
tobiasdiez commented 3 weeks ago

Duplicate of https://github.com/nuxt-modules/storybook/issues/661