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

[v6.0.0-beta.6] Glob not finding stories files #10772

Closed
alexcheuk opened this issue May 13, 2020 · 14 comments
Closed

[v6.0.0-beta.6] Glob not finding stories files #10772

alexcheuk opened this issue May 13, 2020 · 14 comments
Assignees

Comments

@alexcheuk
Copy link

alexcheuk commented May 13, 2020

Describe the bug
Using the same main.js stories configuration as v5.3 fails to find story files in v6.0.0-beta.6.

main.js:

module.exports = {
  stories: ['../packages/**/@(stories.tsx|*.stories.tsx)']
}

This warning shows up when running storybook
image

To Reproduce
Steps to reproduce the behavior:

  1. Update storybook packages to v6.0.0-beta.6
  2. Run storybook
@lpoulter
Copy link

I see this also. It appears to be a false positive as my stories load.

@yannbf yannbf self-assigned this May 14, 2020
@yannbf
Copy link
Member

yannbf commented May 14, 2020

Hey @alexcheuk thanks a lot for opening this issue! A fix is being cooked at the moment 👨‍🍳

@ndelangen
Copy link
Member

I see this also. It appears to be a false positive as my stories load

Unfortunately it's not a false positive..

The value of stories is supposed to be a valid glob. We plan to optimize storybook by moving from a regex evaluated in webpack to a glob evaluated by node.

But we made a mistake, when we wrote the original globs in our docs & CLI generators. It's actually an invalid glob, but it still works, because the glob-to-regex lib makes it work.

In the future instead of using a glob-to-regex we'll use glob solely.

We'll add instructions to migration.md & make the warning clearer on what's really happening.

We'll keep the invalid globs working in storybook for now, but they will break at some point in the future.

@lpoulter
Copy link

But I get the warning with ../packages/**/*.stories.js that's a vaild Glob is it not?

WARN We found no files matching any of the following globs:
WARN
WARN ../packages/**/*.stories.js

@ndelangen
Copy link
Member

interesting, I'll investigate!

@memark
Copy link

memark commented May 27, 2020

I get this issue in 6.0.0-beta.16.

It says the glob is invalid, but my stories are found and displayed in the GUI.
(Removing the glob makes the warning go away, but no stories are found. :) )

Is there any way to make the warning go away? Can I format the glob differently?

@memark
Copy link

memark commented May 27, 2020

Tried generating from scratch with CRA and sb init. Same thing.

@shilman
Copy link
Member

shilman commented May 29, 2020

Gadzooks!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-beta.18 containing PR #10926 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed May 29, 2020
@frebro
Copy link

frebro commented Jun 2, 2020

I confirm the issue is fixed. I was seeing error message for "../components/**/*.stories.mdx" in 6.0.0-beta.5 and they are no longer there after upgrade to 6.0.0-beta.20.

@gastonmorixe
Copy link

I am on 6.0.0-beta.37 and still see it

nfo => Loading custom manager config.
WARN We found no files matching any of the following globs:
WARN
WARN ../src/**/*.stories.(ts|tsx|js|jsx)
WARN
WARN Maybe your glob was invalid?

@yannbf
Copy link
Member

yannbf commented Jul 3, 2020

Hey @gastonmorixe could you please share your glob in main.js? Did you see in the migration file in that the glob format is different than previously used in examples?

https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#correct-globs-in-mainjs

@gastonmorixe
Copy link

@yannbf yeah just saw that, fixed it adding @ now:

"../src/**/*.stories.@(ts|tsx|js|jsx)"

@coreybruyere
Copy link

@gastonmorixe - do you have any presets defined. I'm getting a WebpackOptionsValidationError when adding addon-docs/preset like so:

module.exports = {
  presets: ['@storybook/addon-docs/preset'],
  stories: ['../packages/**/stories/*.stories.@(ts|tsx|mdx)'],
  addons: [
    '@storybook/addon-actions',
    '@storybook/addon-links',
    '@storybook/addon-docs',
    '@storybook/addon-a11y/register',
    '@storybook/addon-viewport/register',
    '@storybook/addon-knobs/register'
  ]
};

@MarcNq
Copy link

MarcNq commented Nov 6, 2020

Could you please point out to a complete specification of what's a correct glob?

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