Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storybook fails to index .story files in 7.3.0 #23850

Closed
yannbf opened this issue Aug 16, 2023 · 4 comments 路 Fixed by #23852
Closed

Storybook fails to index .story files in 7.3.0 #23850

yannbf opened this issue Aug 16, 2023 · 4 comments 路 Fixed by #23852

Comments

@yannbf
Copy link
Member

yannbf commented Aug 16, 2023

Upgraded to Storybook 7.3.0, and all my component stories now fail to indexed, crashing the storybook build. Related to this PR?

WARN 馃毃 Unable to index files:
WARN - ./src/components/Anchor/Anchor.story.tsx: Invariant failed: No matching indexer found for /Project/Frontend/src/components/Anchor/Anchor.story.tsx
...

My main.ts:

import { StorybookConfig } from '@storybook/react-vite';
import { projectConfig } from '../src/project-config';

// Set an env variable, so we can detect Storybook inside other tools (Mainly Tailwind)
process.env.STORYBOOK = 'true';

const config: StorybookConfig = {
  framework: '@storybook/react-vite',
  staticDirs: [
    '../public',
    {
      // Move the favicon.svg to the root, so it can be found by the browser
      from: '../public/assets/favicon.svg',
      to: '/favicon.svg',
    },
  ],
  stories: [
    {
      directory: '../docs',
      titlePrefix: 'Docs',
      files: '**/*.mdx',
    },
    '../src/**/*.@(story|stories).@(js|jsx|ts|tsx)',
  ],
  addons: [
    '@storybook/addon-links',
    {
      name: '@storybook/addon-essentials',
      options: {
        backgrounds: false,
      },
    },
    '@storybook/addon-a11y',
    '@storybook/addon-interactions',
    '@storybook/addon-designs',
  ],
  core: {
    builder: '@storybook/builder-vite',
  },

};

export default config;

Originally posted by @thebuilder in #23691 (comment)

@shilman
Copy link
Member

shilman commented Aug 16, 2023

@ro-ka
Copy link

ro-ka commented Aug 22, 2023

Trying to upgrade to v7.3.2 and I get the same error. It worked fine with <= v7.2.

This is my .storybook/main.js:

module.exports = {
  stories: [
    '../src/**/story.tsx',
    '../src/**/*.story.tsx',
    '../src/**/*/*.mdx',
  ],
  addons: [
    '@storybook/addon-essentials',
    '@storybook/addon-a11y',
    '@storybook/addon-interactions',
  ],
  framework: {
    name: '@storybook/react-vite',
    options: {
      fastRefresh: true,
      strictMode: true,
    },
  },
  docs: {
    autodocs: true,
  },
};

@ro-ka
Copy link

ro-ka commented Aug 24, 2023

@yannbf @shilman Not sure if I shall open a new issue or if this is actually not fully resolved. Thanks for your work on this!

@ro-ka
Copy link

ro-ka commented Sep 4, 2023

It鈥檚 fixed for me with v7.4. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants