-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Open
Labels
Description
Describe the bug
When using CSFNext with experimentalTestSyntax=true 'combined' export statements fail to run and break storybook as they do not resolve the AST tree to the underlying variable and the _stories property does not contain the exported story (and therefore __stats cannot be accessed).
export const Primary = meta.story({}) // <= Works fine
const Primary = meta.story({})
export { Primary }; // <= TypeError: Cannot read properties of undefined (reading '__stats')We use combined exports so that it is easy to check what is exported from a file, especially large ones but this is not compatible with the new .test functionality - though everything else works fine.
Reproduction link
https://stackblitz.com/edit/github-gyecjlwc?file=README.md
Reproduction steps
- Go to above link
- Access the
Buttonstory and observe working correctly with in-line export, and separate export at EOF - Uncomment the
Secondary.test()function. - Observe storybook breaks
System
│ Storybook Environment Info:
│
│ System:
│ OS: macOS 26.2
│ CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
│ Shell: 5.9 - /bin/zsh
│ Binaries:
│ Node: 24.11.0 - ~/.nvm/versions/node/v24.11.0/bin/node
│ Yarn: 1.22.19 - ~/.yarn/bin/yarn
│ npm: 11.6.1 - ~/.nvm/versions/node/v24.11.0/bin/npm <----- active
│ pnpm: 10.20.0 - ~/Library/pnpm/pnpm
│ Browsers:
│ Chrome: 142.0.7444.60
│ Safari: 26.2
│ npmPackages:
│ @storybook/addon-a11y: 10.1.4 => 10.1.4
│ @storybook/addon-docs: 10.1.4 => 10.1.4
│ @storybook/addon-themes: 10.1.4 => 10.1.4
│ @storybook/addon-vitest: 10.1.4 => 10.1.4
│ @storybook/react-vite: 10.1.4 => 10.1.4
│ eslint-plugin-storybook: 10.1.4 => 10.1.4
│ storybook: 10.1.4 => 10.1.4
│ storybook-addon-tag-badges: 3.0.2 => 3.0.2Additional context
No response
dosubot