-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Page endpoint without a GET handler causes client-side navigation to hang #4253
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
Comments
Interestingly, I see the issue in the repro but I can't seem to reproduce it locally on any browser. It might be worth noting that it fails to build the project without setting An error in the stackblitz repro eventually did display (I think triggered by the anchor prefetch): The error in if (is_shadow_page) {
const res = await fetch(
`${url.pathname}${url.pathname.endsWith('/') ? '' : '/'}__data.json${url.search}`,
{
headers: {
'x-sveltekit-load': /** @type {string} */ (shadow_key)
}
}
);
.... |
Any chance this is related to this change? 204 is now being used to mean both fallthrough and redirect. Routes are loading shadow pages for less specific routes (e.g a wildcard route when the first route responds with nothing (or in my case, a redirect). Looks like maybe @aolose has a fix that works for my issue in #4260, it might also fix this issue? |
@lsl I confirmed that the issue does not occur when running @sveltejs/kit 1.0.0-next.291 but does occur when running 1.0.0-next.292. The change you mentioned, #4203, did go in on release 292, so that sounds like the culprit. I don't know enough to be able to say why it broke it, but I can at least narrow stuff down! Here are the repros showing it working on 291 and breaking on 292: 291 = https://stackblitz.com/edit/sveltejs-kit-template-default-yyw5ho |
Is this still an issue with SvelteKit or just something off with StackBlitz? StackBlitz is the only place I've been able to reproduce the issue. I can still reproduce it there as of SvelteKit 1.0.0-next.311 (https://stackblitz.com/edit/sveltejs-kit-template-default-ng3dc8), although it's a little finicky - sometimes it won't hang if I quickly hit the I've tried to reproduce locally from scratch and by copying my StackBlitz project source files, but it never hangs when navigating to a page endpoint w/o a GET handler. Also, there seems to be a test that currently passes for this exact case:
|
I concur that this seems to be an issue with StackBlitz -- I tried it on both Chrome and Firefox on Windows and Ubuntu, and couldn't replicate it in any of those, though the issue still persists on next-347 on StackBlitz. |
Same. Cannot repro locally. Would suggest closing this as a non-SvelteKit issue. |
Locally,
That shouldn't happen. Browsers seem to take it in their stride, but presumably the service worker that handles requests in StackBlitz doesn't like it. Even though it 'works' in browsers, StackBlitz is exposing a legitimate bug, so I think this needs to stay open. |
This was fixed as part of #5778 since __data.json is now always present because it queries not only the page endpoint, but everything leading up to it. |
Describe the bug
If a page has an endpoint without a
get
handler, client-side navigation hands indefinitelyReproduction
Go to https://stackblitz.com/edit/sveltejs-kit-template-default-v3d3wq?file=src%2Froutes%2Fabout.js&terminal=dev, click the
ABOUT
link in the navLogs
No response
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: