#Unable to get JSON body from request

4 messages · Page 1 of 1 (latest)

torpid otter
#

Buffer is a node thing. Have you enabled nodejs_compat for your worker?

delicate fog
#

compatibility_flags = ["nodejs_compat"]

delicate fog
#

I solved the issue by parsing the request manually, but I still don't know where the Buffer is not defined error is coming from because I am not using the Buffer API in my code.

function getBody(event: H3Event) {
    const req = toWebRequest(event)
    return req.json()
}