nuxt-modules / storybook

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

Starting storybook causes a ERROR [commonjs--resolver] Missing "#internal/nuxt/paths" specifier in "nuxt" package #713

Closed kswzr closed 3 weeks ago

kswzr commented 1 month ago

Hello, i have a Nuxt 3.7.3 application where I want to add storybook.

I've run npx storybook-nuxt init and started storybook with yarn storybook. After that following error is thrown:

 ERROR  [commonjs--resolver] Missing "#internal/nuxt/paths" specifier in "nuxt" package                                                                                                                                                                                                                4:39:49 PM

=> Failed to build the preview
Error: Error: Missing "#internal/nuxt/paths" specifier in "nuxt" package
    at defineNuxtConfig (./node_modules/@storybook-vue/nuxt/dist/preset.cjs:6753:11)
    at async Object.viteFinal (./node_modules/@storybook-vue/nuxt/dist/preset.cjs:6774:22)
    at async createViteServer (./node_modules/@storybook/builder-vite/dist/index.js:55:11505)
    at async Module.start (./node_modules/@storybook/builder-vite/dist/index.js:58:1102)

WARN Broken build, fix the error above.
WARN You may need to refresh the browser.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Do you have an idea how I can fix that?

main.ts file content:

import type { StorybookConfig } from "@storybook-vue/nuxt";

const config: StorybookConfig = {
  stories: [
    "../stories/**/*.mdx",
    "../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)",
    "../components/**/*.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",
  },
};
export default config;
tobiasdiez commented 1 month ago

Could you please try https://github.com/nuxt/nuxt/issues/26731#issuecomment-2049213869. You might need to upgrade your nuxt as well.

tobiasdiez commented 3 weeks ago

Closing this issue due to inactivity :zzz: Please reopen the issue with additional information if the problem persists.