Skip to content

TypeError: This stream has already been locked for exclusive reading by another reader #7660

Closed Answered by sergiodxa
mbkProgrammer asked this question in Q&A
Discussion options

You must be logged in to vote

You can only read the body of a request once, and you're calling request.formData() and later using unstable_parseMultipartFormData which also reads the body.

I recommend you to just use unstable_parseMultipartFormData to get the FormData and the files and do the prisma.post.create after that.

Alternatively, you can do request.clone().formData() to clone the request first, but since it comes with files it may consume too much memory.

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@kiliman
Comment options

@sergiodxa
Comment options

@jdaly13
Comment options

@jaschaio
Comment options

@kiliman
Comment options

Answer selected by mbkProgrammer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants