-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
import.meta.url
transformation produces invalid file URL strings
#4461
Comments
I can imagine a modest potential for misuse, considering that, for instance, |
Ran into this problem today, can't run vite cause my project path contains a '#' symbol and vite is bundled with rollup. Why is nobody taking a look at this? |
PR welcome |
@sveinnthorarins I could be wrong but your issue may be a different one as Rollup intentionally replaces some characters like |
@fasttime Thanks for making the PR. Yeah well, from tracking my problem and its error messages, the issue stated here (the poor transformation of The issue you're mentioning might then take on the mantle (of causing me problems) after this issue is fixed 😆 😳 |
This issue has been resolved via #4875 as part of rollup@3.17.3. You can test it via |
Rollup Version
2.70.1
Operating System (or Browser)
Windows
Node Version (if applicable)
v16.14.0
Link To Reproduction
https://github.com/mdjermanovic/rollup-import-meta-url-repro
Expected Behaviour
import.meta.url
to be transformed to an expression that always evaluates to valid URL strings.Actual Behaviour
When
__filename
contains special characters or sequences such as%2F
,new (require('u' + 'rl').URL)('file:' + __filename).href
could be an invalid file URL string.Ref: eslint/eslint#15766
The text was updated successfully, but these errors were encountered: