You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I've got a SvelteKit application set up on netlify using the netlify-adapter. Locally everything works fine. I can make a POST request no problem. However, when I push it up to netlify I get the following error:
ERROR TypeError: Cannot destructure property 'name' of 'req.body' as it is undefined.
specifically on this line of code:
const { name } = req.body;
A console.log of the entire request reveals that the request netlify receives has no body at all.
Looking at the source for the netlify-adapter, I think this line of code might be the culprit.
Expected behavior
I would expect the body of my API request to be appropriately forwarded to the render netlify function.
Severity
I don't think it's a huge deal. I could write out my API routes as raw netlify functions, or, if I wanted to stay in SvelteKit, I could probably turn my body into request query parameters since it looks like they're being forwarded to the renderer, so I have a path forward if I want to keep using netlify. I could probably also try a different host.
The text was updated successfully, but these errors were encountered:
Describe the bug
I've got a SvelteKit application set up on netlify using the
netlify-adapter
. Locally everything works fine. I can make a POST request no problem. However, when I push it up to netlify I get the following error:specifically on this line of code:
A
console.log
of the entire request reveals that the request netlify receives has nobody
at all.Looking at the source for the
netlify-adapter
, I think this line of code might be the culprit.Expected behavior
I would expect the body of my API request to be appropriately forwarded to the
render
netlify function.Information about your SvelteKit Installation:
Diagnostics
Severity
I don't think it's a huge deal. I could write out my API routes as raw netlify functions, or, if I wanted to stay in SvelteKit, I could probably turn my body into request query parameters since it looks like they're being forwarded to the renderer, so I have a path forward if I want to keep using netlify. I could probably also try a different host.
The text was updated successfully, but these errors were encountered: