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

Glob doesn't find anything on windows #191

Closed
eyaldar opened this issue May 14, 2022 · 5 comments
Closed

Glob doesn't find anything on windows #191

eyaldar opened this issue May 14, 2022 · 5 comments
Labels

Comments

@eyaldar
Copy link

eyaldar commented May 14, 2022

Description
I have a folder with a bunch of SVG files on windows, I set SVGSpriteMapPlugin like this:

new SVGSpriteMapPlugin(path.join(__dirname,"src","assets","images","vector","workspaceGallery","*.svg").replace(/\\/g,'/'), {
	output: {
		filename: `sprites/workspaceSprites.svg`,
		svgo: true
	},
	sprite: {
		prefix: false,
		generate: {
			title: false
		}
	}
})

But once I run it it seems that path gets normalized here in line 63 back to backslash based lines which doesnt seem to work with glob.sync anymore (updateDependencies function)

I'm pretty sure i'm missing something here because this used to work for me up until I reinstalled the entire node_modules,
that being said, I did find this node-glob issue which seems to say the same thing.
see also this one

my hacky solution in the meantime is to override use to glob 7.2.0

Expected behavior
The svg files are found no matter what system you use

Actual behavior
glob doesn't find any svg files if the paths are normalized to windows (using backlashes)

System information
Windows 10

Minimal reproduction
Minimal Example

@eyaldar eyaldar added the bug label May 14, 2022
@cascornelissen
Copy link
Owner

Looks like others are also running into this issue:

I can't really test on a Windows setup unfortunately so I'm thinking out loud here... It looks like the allowWindowsEscape option that will be introduced by isaacs/node-glob#468 would solve this? Once that lands you should be able to set it using the input.options option of this plugin.

I can't really make it a default because that could cause breaking changes for users on Windows that actually want to escape characters, which is why the was made in node-glob.

@eyaldar
Copy link
Author

eyaldar commented May 15, 2022

Yeah, should be good enough, in the mean time I forced version 7.2.0 and everything works as it used to be.

@PurTahan
Copy link

in react native throws same error

@nicolas377
Copy link

Glob 7.2.3 was released a few hours ago, which should contain the fix to this issue.

@cascornelissen
Copy link
Owner

I'm closing this as this seems to be resolved, feel free to comment if I misinterpreted 😘

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

No branches or pull requests

4 participants