Your worker created multiple branches of a single stream (for instance, by calling response.clone()
I am getting this when trying to use a cloudflare worker together with the uploadthing library. I have debugged in VS-code and the error is thrown here when uploadthing library calls the safeParseJSON function:
https://github.com/pingdotgg/uploadthing/blob/ea0f3c96f5db2fa945592d5efc06bf84811c5525/packages/shared/src/utils.ts#L233
Here is link to my cloudflare worker:
https://github.com/kristiankauffeld/uploadthing-cf-worker
4 Replies
Seems like a valid warning - it clones but only tries to read the second branch in the event of an error.
@kian it throws the warning even though I commented the cloning part out:
Look for other usages of
clone
the only other place I can find a usage of clone is here, but the warning is thrown before this is reached:
https://github.com/pingdotgg/uploadthing/blob/ea0f3c96f5db2fa945592d5efc06bf84811c5525/packages/uploadthing/src/sdk/utils.ts#L85