Skip to content

james-yeoman/astro-node-serverless-bug

Repository files navigation

Astro node bug - serverless-http

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors