question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Glob doesn't find anything on windows

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
cascornelissencommented, Jun 14, 2022

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

2reactions
nicolas377commented, May 15, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

File explorer search not finding files that are obviously there
When in the file explorer normally I can find files easily by doing control-F then typing in a few letters or if looking...
Read more >
Python glob does not find any results - Stack Overflow
Python glob does not find any results · Try using the full path. Or make sure you are running from the correct directory...
Read more >
Coordinated fix on Feb 12 broke Windows path handling ...
For right now, the only solution I can think of is to pin glob at 7.2.1, or 7.2.0 if 7.2.1 is the issue....
Read more >
glob manual page - Tcl Built-In Commands
This command performs file name “globbing” in a fashion similar to the csh shell or bash shell. It returns a list of the...
Read more >
glob - npm
"Globs" are the patterns you type when you do stuff like ls *.js on the command line, or put build/* in a .gitignore...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found