-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
got Invalid request body when using astro endpoint on vercel #6399
Comments
I checked your code, and it looks like you are missing this line in the Astro config file:
However, this seems to be a bug with the Vercel adapter, it will likely be fixed in the next release. (0e378c3#diff-fcd4c8e46e5a2cfcf6a4685f019e9dab4250dabf3220351d3b5e3df12fdc3c35R104) |
@w3bdesign Yes sorry, I fixed the config and still get the error. Will the next release solve my issue and will I get an error message? and can I use the next release with a version tag right now? |
I can't give a good answer to that yet, but apparently the Astro team is aware of the bug and has commited a fix. I would check https://www.npmjs.com/package/@astrojs/vercel and wait until they get a new release published before trying to use it again. |
It works perfectly with [email protected] thank you all ! |
Note, this requires |
Closing as completed in #6380 |
@MoustaphaDev you should update your reply to not confuse folks to install a typosquatted package. it should be |
Thanks @lirantal, updated! |
What version of
astro
are you using?2.0.15
Are you using an SSR adapter? If so, which one?
Vercel - serverless
What package manager are you using?
pnpm's monorepo
What operating system are you using?
Windows
Describe the Bug
I created a post endpoint which parse the body to extract an email from.
and fetch it in a react client loaded component :
It works perfectly locally but when deployed to vercel, when I call the endpoint I get Invalid request body before running the function. Is it a bug or do I misunderstand something ?
ps : here is my astro.config
thanks for your help and your amazing work !
I've created a minimal reproduction which I've deployed to vercel and I got the same error (that's the link of the deployed project astro-vc4bqx.vercel.app). If you send a post request with a body to https://astro-vc4bqx.vercel.app/signin you will get the error
Link to Minimal Reproducible Example
https://stackblitz.com/edit/astro-vc4bqx?file=src/pages/signin.ts
Participation
The text was updated successfully, but these errors were encountered: