From eb62ed99ce5534fb3923968baf9edc0f4f1efb0d Mon Sep 17 00:00:00 2001 From: Amruth Pillai Date: Tue, 10 Feb 2026 01:43:11 +0100 Subject: [PATCH] remove error-causing plugins in orpc --- src/integrations/orpc/client.ts | 3 +-- src/routes/api/rpc.$.ts | 14 ++------------ 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/integrations/orpc/client.ts b/src/integrations/orpc/client.ts index dc9b1831d..8be675b0e 100644 --- a/src/integrations/orpc/client.ts +++ b/src/integrations/orpc/client.ts @@ -1,6 +1,6 @@ import { createORPCClient, onError } from "@orpc/client"; import { RPCLink } from "@orpc/client/fetch"; -import { BatchLinkPlugin, SimpleCsrfProtectionLinkPlugin } from "@orpc/client/plugins"; +import { BatchLinkPlugin } from "@orpc/client/plugins"; import { createRouterClient, type InferRouterInputs, type InferRouterOutputs, type RouterClient } from "@orpc/server"; import { createTanstackQueryUtils } from "@orpc/tanstack-query"; import { createIsomorphicFn } from "@tanstack/react-start"; @@ -32,7 +32,6 @@ export const getORPCClient = createIsomorphicFn() url: `${window.location.origin}/api/rpc`, fetch: (request, init) => fetch(request, { ...init, credentials: "include" }), plugins: [ - new SimpleCsrfProtectionLinkPlugin(), new BatchLinkPlugin({ mode: typeof window === "undefined" ? "buffered" : "streaming", groups: [{ condition: () => true, context: {} }], diff --git a/src/routes/api/rpc.$.ts b/src/routes/api/rpc.$.ts index fe4594155..3e0b01878 100644 --- a/src/routes/api/rpc.$.ts +++ b/src/routes/api/rpc.$.ts @@ -1,22 +1,12 @@ import { onError } from "@orpc/server"; import { RPCHandler } from "@orpc/server/fetch"; -import { - BatchHandlerPlugin, - RequestHeadersPlugin, - SimpleCsrfProtectionHandlerPlugin, - StrictGetMethodPlugin, -} from "@orpc/server/plugins"; +import { BatchHandlerPlugin, RequestHeadersPlugin, StrictGetMethodPlugin } from "@orpc/server/plugins"; import { createFileRoute } from "@tanstack/react-router"; import router from "@/integrations/orpc/router"; import { getLocale } from "@/utils/locale"; const rpcHandler = new RPCHandler(router, { - plugins: [ - new BatchHandlerPlugin(), - new RequestHeadersPlugin(), - new StrictGetMethodPlugin(), - new SimpleCsrfProtectionHandlerPlugin(), - ], + plugins: [new BatchHandlerPlugin(), new RequestHeadersPlugin(), new StrictGetMethodPlugin()], interceptors: [ onError((error) => { console.error(`ERROR [oRPC]: ${error}`);