Crash when adding dependencies containing #
in the filename
#19563
Labels
p2-edge-case
Bug, but has workaround or limited in scope (priority)
#
in the filename
#19563
Describe the bug
When using
addWatchFile(…)
inside atransform
hook on CSS files to watch a file containing a number sign (#
), Vite errors and the file is not going to be watched.This can be reproduced by a plugin like this:
Which will result into an error like:
I ensured that the return value of
fileURLToPath
contains the proper number sign and I also tried replacing it with%23
or\#
before calling intoaddWatchFile
or even appending a number sign (so the url reads something like/root/public/c#.svg#
), however no scenarios I tried causes the file to be watched.Reproduction
https://github.com/philipp-spiess/vite-css-dependency-number-sign
Steps to reproduce
System Info
Used Package Manager
npm
Logs
In a different repro containing storybook, we're seeing a slightly longer stack trace that might be of help
Click to expand!
The text was updated successfully, but these errors were encountered: