-
-
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
Fetch using load()
in browser get response body but no response body returned during ssr
#5606
Comments
I have also encountered this error and it seems to be an issue with Undici and the way it handles responses from the built-in PHP server or any other responses that don’t contain the I have tested this by including a |
Thanks for the sleuthing @malinowskip. I'm going to close this as the bug is in Undici, and there's basically nothing that can be done about it on the SvelteKit end except wait for nodejs/undici#1540 to be merged and released |
Thanks to both of you @Rich-Harris and @malinowskip , in that case i will wait for the node.js fix to be realeased. For the moment y won't explicity use ssr. Just to comment, the Offerzen doc was amazing @Rich-Harris !! keep going that way. |
I ran into this exact error as well. I came up with a solution that fixed this issue. Instead of starting the Laravel's local development server using the Artisan command I have used XAMPP during development on Windows, and NGINX on the production server. I hope this helps someone too! :) |
Describe the bug
Hi everyone, i'm developing a sveltekit + laravel 9 app and i came across with a problem while testing ssr in my views.
When using the load function in my
index.svelte
thefetch()
response of my laravel api is only readable from the browser but no from the server while rendering.Entering index page triggers the ssr fisrt dispatch which is correct, because my laravel logs show so:
(Data obtained from telescope, a laravel api debugger)
SSR api response headers:
SSR api resonse:
While my client response looks like this:
Browser response headers:
Browser response data:
Everything looks fine here, i've spent many hours looking for a solution but have nothing yet, my thougths are that fetch while ssr is unable to get the data that laravel is sending.
Maybe a header is missconfigured on the server side? Or fetch is not configured to get the data? Maybe fetch in ssr is not configured to take data from a php source?
Thanks to everyone in advance!
Reproduction
Fresh install of a laravel project.
php artisan serve
to run server.Only app URL can be accessed with
http://localhost:8000
index.svelte
Logs
System Info
Severity
serious, but I can work around it
Additional Information
Issue already reported but suggested solution didn't work for me #5327
The text was updated successfully, but these errors were encountered: