Skip to content

[Bug]: Storybook build error occurs with version 1.3.11 or higher #10195

@Thiry1

Description

@Thiry1

Version

System:
    OS: macOS 15.2
    CPU: (8) arm64 Apple M2
    Memory: 96.81 MB / 24.00 GB
    Shell: 3.2.57 - /bin/bash
  Browsers:
    Chrome: 135.0.7049.115
    Chrome Canary: 137.0.7145.0
    Edge: 135.0.3179.98
    Safari: 18.2
  npmPackages:
    @rsbuild/core: 1.3.11 => 1.3.11

Details

When @rsbuild/core is updated to version 1.3.11 or higher, the build process attempts to parse README.md files located in the same directory as .ts files as JavaScript, resulting in a parse error.

File: ./src/README.md:1:1
  × Module parse failed:
  ╰─▶   × JavaScript parsing error: Expected ident
         ╭─[1:1]
       1 │ ## README
         ·  ─
       2 │ a
         ╰────
      
  help: 
        You may need an appropriate loader to handle this file type.

 @ /Users/***/workspace/rspack-bug-repro/src|lazy|/^\.\/.*$/|chunkName: [request]|groupOptions: {}|strict namespace object
 @ ./node_modules/.cache/storybook-rsbuild-builder/storybook-stories.js
 @ ./node_modules/.cache/storybook-rsbuild-builder/storybook-config-entry.js

Reproduce link

Thiry1/rspack-bug-repro@a4f759b

Reproduce Steps

  1. npm i
  2. npm run dev

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions