-
-
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
request.body is no longer nullish for body-less requests made from load's fetch during SSR #2294
Comments
This isn't quite the right reproduction. Closing until I can get this happening outside my project. |
Reopening. It's specifically calls to |
An only lightly-tested change: Replace
with
|
One of the TypeScript nuances here is that Another question is what to do when someone explicitly passes |
Describe the bug
As of version
1.0.0-next.151
,request.body
in thehandle
hook was nullish when the request had no body and was sent viaload
'sfetch
during SSR from some page.As of version
1.0.0-next.152
(#2215), it is nowUint8Array(0) []
.This is inconvenient when you want your
handle
hook to callfetch
to proxy some requests, as you can no longer pass therequest
object as the second argument tofetch
.Reproduction
Starting from the sample app, update the
handle
hook as so:Navigate to the
/todos
page (which makes API calls), and hit refresh to get a server-rendered page.Logs
(in the above repro)
(in my app)
System Info
Severity
serious, but I can work around it
Additional Information
We've previously blessed calling
fetch
inhandle
as a way to deal with API calls in SSR where the app server and the API server live in different places, but are both behind the same reverse proxy when seen from a browser.The text was updated successfully, but these errors were encountered: