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

node-glob not finding paths on windows #130

Open
peterhodges opened this issue Oct 14, 2022 · 2 comments
Open

node-glob not finding paths on windows #130

peterhodges opened this issue Oct 14, 2022 · 2 comments

Comments

@peterhodges
Copy link

Attempting to use the plugin with Storybook 6.5.9 on Windows and it fails silently by not showing any tokens in the panel or via the doc blocks.

On debugging, it's clear that the glob.sync is returning an empty array in plugin.js getTokenFilePaths().

The path is joined onto the context which, on windows, has back slashes: C:\repos\design-tokens and ends up as C:\repos\design-tokens\**\*.css before being passed to glob.sync, which only supports POSIX paths.

If I replace backslashes slashes after joining the strings with path.join(), it works fine.

const paths = glob.sync(path.replace(/\\/g, '/'));

It works fine for me using the webpack5 demo from this repo (earlier version of storybook).

From a quick google, it looks like the node-glob package has always worked like this so I'm not sure why it's breaking now.

@peterhodges
Copy link
Author

peterhodges commented Oct 17, 2022

More info here: isaacs/node-glob#467

Looks like backslashes were never explicitly supported but worked in v7 of node-glob (no longer in v8).

@Sqrrl
Copy link
Collaborator

Sqrrl commented Dec 16, 2022

Thanks for reporting and sorry for the delay. I've added your proposed fix with v2.8.1. Would be great if you could check it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants