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
Certain globs not finding stories #16924
Comments
We've had a similar problem. We used to use (<= stories: ["../@(src|docs)/**/*.stories.@(tsx|mdx)"], but now, on We get the following message in the sidebar.
The
There are zero build warnings logged. The only error in the console is specifically the one saying that it can't find the matching story, either Thanks for all the stuff you do |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
This is a problem |
Apologies about the delay, here is the fix: #17252 |
Shiver me timbers!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.5.0-alpha.19 containing PR #17252 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
Yo-ho-ho!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.4.14 containing PR #17252 that references this issue. Upgrade today to the
|
Hello, thanks for the fix. However I'm still seeing issues with this:
with file structure:
Am I missing something? |
@andrewplummer hmm, no obvious reason why one would work but not the other. Can you create a reproduction? |
Sure, I added one here: https://github.com/andrewplummer/storybook-test
I would expect any one of these globs to match yet none of them do. |
Hey @andrewplummer I can see two things wrong here.
|
I see the problem now. However it's all quite confusing isn't it? I'm not sure I understand the point of globs named As it is you would have to have read the entire docs (down to the bottom paragraph) to know what's going on. |
Yeah, we need to process the MDX file in a special way which requires Webpack to know about the location of all "mdx story" files. I agree it's an annoying and arbitrary restriction and we'll probably try to get rid of it in the future. |
I mean... fair enough if it's a hard restriction then I get it but what is the point then of having globs? Aren't the globs what is pointing at the mdx story files? I feel like I'm missing something. |
I guess it is a technical limitation @andrewplummer, rather than a product decision. A couple of things that might help:
Technically we could probably automatically do 3, based on detecting that you've used a non-standard mdx-matching glob for your What is probably a good idea is that we could log an error or a warning if you write a |
Ah I see so basically the globs work with mdx files but with some restrictions. |
Always open for documentation improvement PRs! |
I spent a day digging into code before I was able to find this issue. 😭 |
Describe the bug
While updating from 6.3.6 to 6.4.4, we found that certain globs provided to
stories
no longer work. Specifically, we use globs like to following based on whether we want all stories from our monorepo or only those from a single packages:../../../packages/*/{src,stories}/**/*.stories.{js,jsx,ts,tsx}
../../../packages/foo-bar/{src,stories}/**/*.stories.{js,jsx,ts,tsx}
(we resolve these to be absolute, but it doesn't seem to matter in the repro repo)
After updating, the former (with
*
) works as expected, but the more specific (withfoo-bar
) fails to find any stories despite there being some.To Reproduce
https://github.com/matt-tingen/storybook-glob-repro
System
Additional context
We don't use this glob, but while debugging, I found that
../../../packages/foo-bar/src/**/*.stories.{js,jsx,ts,tsx}
also works so it seems like it's the combination offoo-bar
and{src,stories}
that fails.The text was updated successfully, but these errors were encountered: