-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
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:
Uncaught TypeError: Failed to construct 'URL': Invalid URL
at data:text/html;chars…8L2h0bWw+Cg==:16:13
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:
Uncaught TypeError: Failed to construct 'URL': Invalid URL
at about:blank:16:13
Describe the proposed solution
Sveltekit always generates
<body data-sveltekit-preload-data="hover">
<div style="display: contents">
<script>
{
__sveltekit_1bknoa9 = {
base: new URL('.', location).pathname.slice(0, -1)
};
where new URL('.', location)
will fail when location.protocol
is data://
or about://
Alternatives considered
No response
Importance
would make my life easier
Additional Information
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working