You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"NoMeta error" with Storybook v7 with typescript satisfies
Stories that use the satisfies keyword in TypeScript aren't being found by test-runner.
On Storybook v7, when running the storybook init command, the stories created use the new typescript satisfies keyword by default.
exportdefault{title: "Example/Header",component: LoggedIn,// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/7.0/react/writing-docs/docs-pagetags: ["docsPage"],parameters: {// More on how to position stories at: https://storybook.js.org/docs/7.0/react/configure/story-layoutlayout: "fullscreen",},}satisfiesMeta<typeofLoggedIn>;
However unless they are explicitly marked with as the stories are not found, and a NoMetaError: CSF: missing default export (line 1, col 0) is thrown.
Steps to reproduce the behavior
Run the storybook init for v7 beta
Check the default stories use the satisfies keyword
Install test runner
Run test runner
See NoMetaError: CSF: missing default export (line 1, col 0) for the componet
Replace satisfies for as and check that the component now tests correctly
Expected behavior
Accept satisfies aswell as as
Have a clearer warning around what's happening
Don't default to 'satisfies' for storybook init in new projects
Screenshots and/or logs
AIL browser: chromium stories/Page.stories.ts
● Test suite failed to run
NoMetaError: CSF: missing default export (line 1, col 0)
More info: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
at CsfFile.parse (node_modules/@storybook/test-runner/node_modules/@storybook/csf-tools/dist/cjs/CsfFile.js:480:15)
at transformCsf (node_modules/@storybook/test-runner/dist/cjs/csf/transformCsf.js:65:7)
at transformPlaywright (node_modules/@storybook/test-runner/dist/cjs/playwright/transformPlaywright.js:89:49)
at Object.process (node_modules/@storybook/test-runner/playwright/transform.js:6:21)
Environment
OS: MacOS Monteray
Node.js version: 18
Additional context
Just wanted to say thanks for the amazing work you're all doing!
The text was updated successfully, but these errors were encountered:
Hey @ollie-bud thank you so much for opening this issue! The test runner does not yet support the satisfies operator. Well add support as soon as we can, probably after the holidays. Have a nice one!
"NoMeta error" with Storybook v7 with typescript satisfies
Stories that use the
satisfies
keyword in TypeScript aren't being found by test-runner.On Storybook v7, when running the storybook init command, the stories created use the new typescript
satisfies
keyword by default.However unless they are explicitly marked with
as
the stories are not found, and aNoMetaError: CSF: missing default export (line 1, col 0)
is thrown.Steps to reproduce the behavior
satisfies
keywordNoMetaError: CSF: missing default export (line 1, col 0)
for the componetsatisfies
foras
and check that the component now tests correctlyExpected behavior
satisfies
aswell asas
Screenshots and/or logs
Environment
Additional context
Just wanted to say thanks for the amazing work you're all doing!
The text was updated successfully, but these errors were encountered: