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

"MetaDataError: CSF missing default export" on *.stories.tsx files which has companion .mdx files #17086

Open
erik-d opened this issue Dec 28, 2021 · 2 comments

Comments

@erik-d
Copy link

erik-d commented Dec 28, 2021

Describe the bug
Using SB 6.4.9 and feature flag storyStoreV7: true.
In the terminal (running server) I get a lot of info Skipping NoMetaError: CSF: missing default export (line 1, col 0 . These *.stories.tsx files, that gets these NoMetaError, have all a companion mdx file, ex. Button.stories.tsx & Button.stories.mdx.
In this case the .tsx files should not have export default { title: 'Button', ...} according to documentation.

To Reproduce
See description.

System
Environment Info:

System:
OS: macOS 12.0.1
CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
Binaries:
Node: 14.17.6 - ~/.nvm/versions/node/v14.17.6/bin/node
Yarn: 1.22.15 - ~/.yarn/bin/yarn
npm: 7.24.2 - ~/Work/develop/spx-react-ui/node_modules/.bin/npm
Browsers:
Chrome: 96.0.4664.110
Firefox: 93.0
Safari: 15.1
npmPackages:
@storybook/addon-actions: ^6.4.9 => 6.4.9
@storybook/addon-docs: ^6.4.9 => 6.4.9
@storybook/addon-essentials: ^6.4.9 => 6.4.9
@storybook/addon-interactions: ^6.4.9 => 6.4.9
@storybook/addon-links: ^6.4.9 => 6.4.9
@storybook/addons: ^6.4.9 => 6.4.9
@storybook/core-events: ^6.4.9 => 6.4.9
@storybook/react: ^6.4.9 => 6.4.9
@storybook/testing-library: 0.0.7 => 0.0.7
@storybook/theming: ^6.4.9 => 6.4.9

@micahgodbolt
Copy link
Contributor

Hitting this myself. We have individual files for each story, and then a single top level story file with default export that re-exports the individual stories. The warning is hitting for each of the FooSmall.stories.tsx file that is imported into Foo.stories.tsx.

We could change the extension on FooSmall, but they ARE stories and are linted as such.

@BorisL91
Copy link

BorisL91 commented Sep 20, 2022

Any update on this topic? I happen to run into this when integrating the test-runner for interaction testing.

Also using .tsx and .mdx files in our component library.

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

5 participants