Next.js Discord

Discord Forum

Error: failed to pipe response

Unanswered
Silky ant posted this in #help-forum
Open in Discord
Silky antOP
Next 14 fails to pipe a response that works fine in 13. Any idea how to fix? Error message make it sounds like it's a bug with next 14.

TypeError [ERR_INVALID_ARG_TYPE]: The "transform.writable" property must be an instance of WritableStream. Received an instance of WritableStream
      at new NodeError (node:internal/errors:405:5)
      at ReadableStream.pipeTo (node:internal/webstreams/readablestream:414:15)


My api route is returning a basic stream.

const myStream = new ReadableStream({
        async start(controller) {
        ...
        },
    });

    return new Response(myStream);

0 Replies