-
-
Notifications
You must be signed in to change notification settings - Fork 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
Handle cases when location.protocol is about:
or data:
#13226
Comments
CNSeniorious000
changed the title
Handle cases when location.protocal is
Handle cases when location.protocol is Dec 23, 2024
about:
or data:
about:
or data:
kit/packages/kit/src/runtime/server/page/render.js Lines 103 to 113 in 64c8e04
An ugly fix would be - `new URL(${s(base)}, location).pathname.slice(0, -1)`
+ `["about:", "data:"].includes(location.protocol) ? `${s(base)} : new URL(${s(base)}, location).pathname.slice(0, -1)`
- new URL('.', location).pathname.slice(0, -1)
+ ["about:", "data:"].includes(location.protocol) ? "" : new URL('.', location).pathname.slice(0, -1) |
You are welcome to open a pull request. Are there any other protocols we need to consider? Maybe we can create a set and search that. |
6 tasks
I think maybe |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the problem
I am using svelte in several embedded webviews. I used to have to run a static file server before
bundleStrategy: 'inline'
became available yesterday.Normally (if we click this html file) the url will start with
file://
, and everything works fine.But In the webview implementation I use the url is a data url, and hydration always fails because of:
In another case, I want to parse metadata from an url using an iframe, but sveltekit apps always fail to hydrate because of a similar error:
Describe the proposed solution
Sveltekit always generates
where
new URL('.', location)
will fail whenlocation.protocol
isdata://
orabout://
Alternatives considered
No response
Importance
would make my life easier
Additional Information
No response
The text was updated successfully, but these errors were encountered: