Vite does not sanitize path leading up to glob before handing it to fast-glob #9833
Closed
7 tasks done
Labels
p3-downstream-blocker
Blocking the downstream ecosystem to work properly (priority)
Describe the bug
import.meta.glob
does not work when executing inside a path that has braces, the files to glob are not found because of a missing glob sanitization.Example:
If I do
import.meta.glob('./*.md')
the file isn't found. The culprit is thetoAbsoluteGlob
function in the Vite codebase not sanitizing the path leading up to the glob. That path could contain characters that are special tofast-glob
, like(
,)
,[
,]
.This affects SvelteKit users since the layout rework because folders starting with
(
and ending with)
like(group)
have special meaning now, which means people start using that, and allimport.meta.glob
invocations inside such folders won't work: sveltejs/kit#6239Reproduction
https://stackblitz.com/edit/vitejs-vite-brmhvp?file=main.js,(blog)%2Ffind-posts.js,blog%2Ffind-posts.js&terminal=dev
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: