-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Client does not hydrate in Safari when accessed over network due to a "Unhandled Promise Rejection" #10261
Comments
Here is the part of the code generated/shipped by sveltekit that throws the error in my safari browser: async function get_navigation_result_from_branch({
url,
params,
branch,
status,
error,
route,
form
}) {
/** @type {import('types').TrailingSlash} */
let slash = 'never';
for (const node of branch) {
if (node?.slash !== undefined) slash = node.slash;
}
url.pathname = normalize_path(url.pathname, slash);
// eslint-disable-next-line
url.search = url.search; // turn `/?` into `/`
/** @type {import('./types').NavigationFinished} */
const result = {
type: 'loaded',
state: {
url,
params,
branch,
error,
route
},
props: {
// @ts-ignore Somehow it's getting SvelteComponent and SvelteComponentDev mixed up
constructors: compact(branch).map((branch_node) => branch_node.node.component) // This is line 351
}
};
``` |
"Chrome on iOS" is Safari. Well all the browsers in iOS are just skinned Safari |
I can't repro this - steps I followed
Is there anything I did differently? This does sound similar to #8529 & #2889, which have both been tricky to track down. |
I tried to recreate it again today, and the error no longer occurs. My phone has not been restarted, nor has safari. Even my dev server was still running since the last time I tested this yesterday, without me having made any changes to the project. Now it all magically works. No error is being thrown. The code output has not changed either. The script now just runs... |
I'm going to close this issue due to it clearly being safari being buggy, and if not, the previously linked issues practically describe the same problem. If GitHub showed that issue when I searched for it, I would've just replied to that issue instead in the first place. Feel free to re-open this if needed. |
Describe the bug
When you
npm run dev --host
the client does not hydrate due to the error shown in the logs section of this issue. It appears to happen whenever you access the site over the network. Locally it all works fine.Reproduction
It should work with any new initialised project.
npm run dev --host
It also happens when I download this project and run it locally:
https://stackblitz.com/edit/sveltejs-kit-template-default-q5pusk?file=README.md
Logs
System Info
The command did not output anything. Also, due to me using multiple devices, I doubt the specific information is helpfull.
I use the latest version of SvelteKit, Vite, Svelte 4.0, Chrome and Safari. If you still need the full logs, let me know.
Severity
blocking all usage of SvelteKit
Additional Information
No response
The text was updated successfully, but these errors were encountered: