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

Stories not available when file name starts with 'config'. #13445

Closed
MBelniak opened this issue Dec 14, 2020 · 5 comments
Closed

Stories not available when file name starts with 'config'. #13445

MBelniak opened this issue Dec 14, 2020 · 5 comments

Comments

@MBelniak
Copy link

MBelniak commented Dec 14, 2020

I think it's a bug. I have a component called 'ConfigSelector' and few stories in 'config-selector.tsx'. Stories from this file are not visible in storybook. Stories from other files I have work OK. If I change the name of file to sth not starting with 'config', stories are visible. FYI my storybook configuration files are in separate directory.

Steps to reproduce the behavior:

  1. Create a story of some dummy component in file named "config-whatever.tsx"
  2. Run storybook

Result:
No stories from "config-whatever.tsx" available.

Expected behavior
Stories from "config-whatever.tsx" are visible.

This happens with @storybook/react 6.1.10

@shilman
Copy link
Member

shilman commented Dec 14, 2020

Do you have a repro repo you can share?

@MBelniak
Copy link
Author

I can't share the one I have, but I'll try to create a small repro repo later. Digging deeper into that I realized that for some names it works, for other it doesn't, with strong no-working correlation for names starting with a letter 'c' (except for 'checkbox.tsx') As soon as I change the first letter to some other it works. Is there any naming convention or something which I'm not aware of?

@shilman
Copy link
Member

shilman commented Dec 14, 2020

@MBelniak nothing that i know of, and this is the first i'm hearing of it. i suspect it's a configuration issue, but won't know until i see the repro.

@MBelniak
Copy link
Author

I find it too ridiculous to be a storybook issue too, so let me make a repro repo.

@MBelniak
Copy link
Author

MBelniak commented Jan 7, 2021

It turned out to be a problem with style-loader configuration. I had an option insert: top, which caused the following error in one of my component: Unexpected error while loading ./datagrid.tsx: Error: Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid. which showed up in static storybook. This happened because of upgrading style-loader, where this option does not seem to accept 'top' any longer. When developing with webpack-dev-server everything seemed to work fine after the first webpack-dev-server refresh, but before that, the stories didn't show up. Weirdly, that affected the story named 'config-selector', I have no clue why. After removing the aforementioned option from style-loader everything started to work porperly.

@MBelniak MBelniak closed this as completed Jan 7, 2021
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

2 participants