Astro Info
Astro v6.3.6
Node v24.13.0
System Linux (x64)
Package Manager pnpm
Output server
Adapter @astrojs/node
Integrations none
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
(copied from the readme in my reproduction repo)
Astro seems to assume that if req.body exists, it's either a string, or it's been parsed by
some middleware from whichever server framework the IncomingMessage came from. See here
Serverless-http however, makes ctx.req.body a buffer. So it gets caught in the typeof req.body === 'object' clause. See here and here
So what ends up happening, is rather than the buffer just being passed through, it gets JSON-stringified, and the action payload ends up being {type: "Buffer", data: [...]}, which causes an AstroActionInputError.
What's the expected result?
Astro should have a branch to pass through buffers in makeRequestBody in packages/astro/src/core/app/node.ts
Link to Minimal Reproducible Example
https://github.com/james-yeoman/astro-node-serverless-bug
Participation
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
(copied from the readme in my reproduction repo)
Astro seems to assume that if
req.bodyexists, it's either a string, or it's been parsed bysome middleware from whichever server framework the IncomingMessage came from. See here
Serverless-http however, makes ctx.req.body a buffer. So it gets caught in the
typeof req.body === 'object'clause. See here and hereSo what ends up happening, is rather than the buffer just being passed through, it gets JSON-stringified, and the action payload ends up being
{type: "Buffer", data: [...]}, which causes anAstroActionInputError.What's the expected result?
Astro should have a branch to pass through buffers in makeRequestBody in
packages/astro/src/core/app/node.tsLink to Minimal Reproducible Example
https://github.com/james-yeoman/astro-node-serverless-bug
Participation