Skip to content

Cannot find module error with stories: ['../**/*.stories.ts'] #56

Open
@alcpereira

Description

@alcpereira

How to reproduce

In sandboxes/react-18/.storybook/main.ts, change the following:

- stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
+ stories: ['../src/**/*.mdx', '../**/*.stories.@(js|jsx|mjs|ts|tsx)'],

I tried playing around, and here are some variations

# Normal setup
['../src/**/*.stories.ts']        # Works
['../**/*.stories.ts']            # Does not work
# With more than one folder
['../src/**/*.stories.ts', '../components/**/*.stories.ts'] # Works

I double checked (just mental sanity check) that the glob is correct:

❯ glob '../**/*.stories.ts'
../src/stories/ReExportButton.stories.ts
../src/stories/Page.stories.ts
../src/stories/Header.stories.ts
../src/stories/Button.stories.ts

It works with @storybook/react-vite and @storybook/react-webpack5

Version used

Tested with the current main (commit 63c89bc4f0fff2a45ba75c2161291f9c6f78b46e) and released version 0.10.0 of storybook-builder-rsbuild.

I'm using pnpm if that makes a difference too

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions