-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
fix: update client.ts@cleanUrl to accomodate blob protocol #16182
Conversation
i would like to display view in browser using blob. But it is not 'hot update' because the using protocol 'blob'. It cause an TypeError: Failed to construct 'URL': Invalid URL at client.ts@cleanUrl. So thats why i change the code at client.ts@cleanUrl, line 114.
Run & review this pull request in StackBlitz Codeflow. |
Would you create a reproduction or add a test? I don't understand when this happens. |
I tried to make this dummy. TESTING VITE using Blob Source in
|
I see. I'm not sure if we would support that case but I'm fine with merging this PR as the change is small. A reproduction without PHP: https://stackblitz.com/edit/vitejs-vite-sug7dr?file=main.js&terminal=dev |
Description
I would like to display view in browser using blob. But it is not 'hot update' because the using of blob protocol on the url
blob:http://localhost:8000/13a653f9-99c8-472c-94a2-7ed6b5c9b917
. It cause anTypeError: Failed to construct 'URL': Invalid URL at line client.ts:126
.Before:
const url = new URL(pathname, location.toString());
After:
const url = new URL(pathname, location.protocol === 'blob:' ? location.pathname : location.toString());
Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).