diff --git a/src/runtime/api.ts b/src/runtime/api.ts index e9e307d..53266a9 100644 --- a/src/runtime/api.ts +++ b/src/runtime/api.ts @@ -9,7 +9,7 @@ import type { } from '@trpc/server' import { createURL } from 'ufo' import type { CompatibilityEvent } from 'h3' -import { defineEventHandler, isMethod, useBody } from 'h3' +import { defineEventHandler, isMethod, readBody } from 'h3' import type { TRPCResponse } from '@trpc/server/dist/declarations/src/rpc' type MaybePromise = T | Promise @@ -63,7 +63,7 @@ export function createTRPCHandler({ req: { method: req.method!, headers: req.headers, - body: isMethod(event, 'GET') ? null : await useBody(event), + body: isMethod(event, 'GET') ? null : await readBody(event), query: $url.searchParams, }, path: $url.pathname.substring(endpoint.length + 1),