Skip to content

Issue with using CompressionPlugin() #1787

Description

@VesperQuartz

I am importing as import { CompressionPlugin, RPCHandler } from "@orpc/server/fetch";

Anytime i use the plugin i get the error "Cannot parse response body, please check the response body and content-type."

And if i remove it everything works fine

const handler = new RPCHandler(router, {
	plugins: [
		new CORSPlugin({
			origin: (origin, _options) => origin,
			allowMethods: ["*"],
		}),
		new RethrowHandlerPlugin({
			// Decide which errors should be rethrown.
			filter: (error) => {
				return !(error instanceof ORPCError);
			},
		}),
		new BatchHandlerPlugin(),
		new CompressionPlugin(), // <---- ii have to remove this for it to work
		new RequestHeadersPlugin(),
		new ResponseHeadersPlugin(),
	],
});

Also am using cloudflare don't know if that has anything to do with it but just say i should mention.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions