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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Storybook 8 + Vite + Turbosnap => Failed to retrieve dependent story files #28973

Closed
julianCast opened this issue Aug 26, 2024 · 1 comment

Comments

@julianCast
Copy link

julianCast commented Aug 26, 2024

Describe the bug

Having the following:
Storybook: 8.2.5
React-Vite: 8.2.5
Turbosnap enabled (onlyChanged)

If I set onlyChanged: false everything works fine. I don't have any vite.config.ts file.

Structure

image

Main.ts

const config: StorybookConfig = {
  stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
  addons: [
    getAbsolutePath("@storybook/addon-a11y"),
    getAbsolutePath("@storybook/addon-links"),
    getAbsolutePath("@storybook/addon-essentials"),
    getAbsolutePath("@storybook/addon-interactions"),
  ],
  framework: {
    name: getAbsolutePath("@storybook/react-vite"),
    options: {},
  },
  async viteFinal(config, { configType }) {
    const { mergeConfig } = await import("vite");

    if (configType === "DEVELOPMENT") {
      // Your development configuration goes here
    }
    if (configType === "PRODUCTION") {
      // Your production configuration goes here.
    }
    return mergeConfig(config, {
      // Your environment configuration here
    });
  },
  typescript: {
    check: true,
    reactDocgen: "react-docgen-typescript",
    reactDocgenTypescriptOptions: {
      shouldExtractLiteralValuesFromEnum: true,
      propFilter: (prop) => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true),
    },
  },
  docs: {
    autodocs: true,
  },

Action.yml

image

I get the following error:

image

Reproduction link

Not provided

Reproduction steps

No response

System

Storybook Environment Info:

  System:
    OS: macOS 14.4.1
    CPU: (8) arm64 Apple M1 Pro
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
    Yarn: 3.8.3 - ~/.nvm/versions/node/v20.12.2/bin/yarn <----- active
    npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm
  Browsers:
    Chrome: 127.0.6533.122
    Edge: 128.0.2739.42
    Safari: 17.4.1
  npmPackages:
    @storybook/addon-a11y: ^8.2.5 => 8.2.5
    @storybook/addon-docs: ^8.2.5 => 8.2.5
    @storybook/addon-essentials: ^8.2.5 => 8.2.5
    @storybook/addon-interactions: ^8.2.5 => 8.2.5
    @storybook/addon-links: ^8.2.5 => 8.2.5
    @storybook/react: ^8.2.5 => 8.2.5
    @storybook/react-vite: ^8.2.5 => 8.2.5
    @storybook/test: ^8.2.5 => 8.2.5
    @storybook/test-runner: ^0.19.1 => 0.19.1
    eslint-plugin-storybook: ^0.8.0 => 0.8.0
    storybook: ^8.2.5 => 8.2.5

Additional context

Wasn't happening in Storybook 7

@julianCast
Copy link
Author

Fixed here

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

No branches or pull requests

2 participants
@julianCast and others