Req.body is ReadableStream { locked: false, state: 'readable', supportsBYOB: false } When using NextApiRequest #54355
Replies: 4 comments 7 replies
-
|
I believe you should use |
Beta Was this translation helpful? Give feedback.
-
|
I did this and it worked //Convert ReadableStream to JSON ref.https://stackoverflow.com/a/74237249/7437570 |
Beta Was this translation helpful? Give feedback.
-
|
Hi, I have the same issue. I'm using try catch block inside api route handlers. I do the doing EDIT: I've found a solution It can be solved with However there is a gotcha So the solution in my case looks like this |
Beta Was this translation helpful? Give feedback.
-
|
ITS OUTPUT I AM GETTING IS THIS , BUT IT USED TO GIVE IMAGE URL WHAT TO DO import Replicate from "replicate"; enum ASRTIO { enum OPFRMT { interface args { export default async function one(arg: args) { // Validate required fields // if (!userPrompt) { const replicate = new Replicate({ auth: apikey}); const input = { console.log('ReplicateImageClient Input:', input); const {output} = await replicate.run("black-forest-labs/flux-schnell", { console.log('ReplicateImageClient Output:', output); |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
Software Spec
App Structure
I have a helper to get a figma auth token using nextApiRequest (Thank you for @seanchas116 commitment)
Also, I would like to integrate with external APIs(Figma REST) in NextJS and make a POST request
While utilizing the route features on the lower version of nextjs in this project, I faced the the error. Working on POSTMAN so it's not related to invalid token
It's not data issue


Client Component
Server Router
Errors
When I log
console.log("server POST call body",body);,ReadableStream { locked: false, state: 'readable', supportsBYOB: false }happensI'm trying to
const body = await req.body.json();butTypeError: req.body.json is not a functionPlease help this situation. THank you
Beta Was this translation helpful? Give feedback.
All reactions