Skip to content

Conversation

@dev-hari-prasad
Copy link

The dev server previously used decodeURI() when resolving public assets.
decodeURI() does not decode reserved characters like %23 (#) or %3F (?), causing valid public files such as my#image.svg to return 404 in dev.

Replacing it with decodeURIComponent() correctly decodes these filenames and fixes the resolution of percent-encoded asset paths.

Fixes #20799.

…racters

The dev server previously used decodeURI() when resolving public assets.
decodeURI() does not decode reserved characters like %23 (#) or %3F (?), causing valid public files such as my#image.svg to return 404 in dev.

Replacing it with decodeURIComponent() correctly decodes these filenames and fixes the resolution of percent-encoded asset paths.

Fixes vitejs#20799.
@bluwy
Copy link
Member

bluwy commented Dec 10, 2025

Please add tests to confirm the fix.

@dev-hari-prasad
Copy link
Author

I have added the test for percent-encoded public file paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

On devserver public files cannot be loaded if they contain special url characters like #

2 participants