Skip to content
Discussion options

You must be logged in to vote

Hi @kas0189! I'm Dosu and I’m helping the storybook team.

The error happens because Storybook 10.x expects addon and builder names as plain strings, not resolved paths. Wrapping them with getAbsolutePath or import.meta.resolve causes Storybook to try importing a directory, which triggers the "ERR_UNSUPPORTED_DIR_IMPORT" error details.

To fix it, update your .storybook/main.ts like this:

import type { StorybookConfig } from '@storybook/react-vite';

const config: StorybookConfig = {
  framework: {
    name: '@storybook/react-vite',
    options: {
      builder: {
        viteConfigPath: '.storybook/vite.config.js'
      }
    }
  },
  stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kas0189
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant