-
-
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
In adapter-netlify split:true config is breaking SSR and other things. #4872
Comments
Ah... yep. This is an unanticipated problem of introducing page endpoints — the platform-level router won't execute the kit/packages/adapter-netlify/index.js Line 213 in 82cd1d7
...probably needs to be accompanied by one with the Currently that would mean adding that redirect for all routes, regardless of whether a given route a) is a page or b) has a corresponding endpoint. Ideally the A broader point: we really should have some e2e tests that would make it easier to catch these sorts of things. |
Happy to try and tackle this. From initial testing of the fix that Rich had suggested, it looks like a bit of a timing/race condition issue is at play as well at kit/packages/adapter-netlify/index.js Line 180 in 6ca3508
where the Promise returned by
From what I was able to find in the docs it looks like the If so, I can add some code to explicitly check for |
Could we open this back up? It looks like we are still breaking something along the way. I upgraded the old site and it still 404's, but a new SvelteKit site gets a 500 error on those SSR routes. On a client side refresh, I can load the endpoint route on the "old" upgraded site, but the new one only gets a 500. |
Any update on the issue? I am having the same issue, getting 404 even when I havnt set |
Interesting 🤔 I'll take another look at this again and see if I can puzzle out what's happening |
@ericapisani I have a repo to reproduce this here, I hope it will be helpful to you: https://github.com/winston0410/netlify-repo |
I've forked the old test site that you had created and after upgrading the version of @sveltejs/adapter-netlify to Deployed test site can be found here If that site continues to experience issues with that upgrade, could you please specify what steps you're taking to reproduce error?
I've also forked the new SvelteKit site that you mentioned above, and it appears that the 500 error that you're mentioning is due to missing import. In this file the following line is throwing a TypeError:
and it's due to @winston0410 I was just going to ask about a repro project 😄 Thank you so much, I'll take a look now |
@winston0410 Just deployed the repro project you had provided by following the instructions in the README, and it appears to be deploying correctly with no 404 on the home page - is there a step that I'm missing to reproduce the error? |
@ericapisani Have you set |
@winston0410 Ah, that seems to have done the trick, thank you! Will continue investigating 🕵🏻♀️ |
@winston0410 I think this is a cache issue of some kind. When I built and deployed the project with When I removed the Test 1: Defaults
Test 2: Explicitly define default values
Test 3: Set split to true
Would you mind giving that a try (deleting the |
@ericapisani I have just tried it again, and cache is the issue, that's a tricky one to catch! And I can confirm that after I have removed all the cache, |
Thanks for the updates on this. I was on vacation and just getting back and catching up. I will run these when I jump on. There is another ongoing issue with SvelteKit building on Netlify and want to make sure this change isn't causing that error as well. It is closed, but not fixed so I've got some digging to do. #5337 |
It sounds like we can close this again — thanks all |
Describe the bug
When
split: true
is enabled in thesvelte.config.js
foradapter-netlify
, SSR routes when navigated to with client side navigation gets a 404. The endpoint route will work on refresh, but the todo page goes to a Netlify 404 page does not exist skipping the__error.svelte
route.Reproduction
Repo of demo app with
adapter-netlify
: https://github.com/brittneypostma/test-ssr-splitPreview deploy of site with
split: false
and__error.svelte
working: https://627c04fe0cebc30008f3f36b--test-ssr-split.netlify.app/endpointPreview deploy of site with
split: true
and__error.svelte
not catching on /todos refresh: https://627c046d20bc620009be8eef--test-ssr-split.netlify.app/endpointLogs
`GET /endpoint/__data.json 404`
System Info
Severity
serious, but I can work around it
Additional Information
Only workaround is to turn off split, which isn't ideal.
The text was updated successfully, but these errors were encountered: