koko#1337
koko#1337
TtRPC
Created by koko#1337 on 5/26/2023 in #❓-help
TRPCClientError: fetch failed
I get the below error when createTRPCProxyClient runs on BE of a Next.JS app hosted on Vercel:
TRPCClientError: fetch failed
at TRPCClientError.from (file:///var/task/node_modules/@trpc/client/dist/transformResult-9a244fe7.mjs:13:16)
at file:///var/task/node_modules/@trpc/client/dist/links/httpBatchLink.mjs:211:64 {
meta: undefined,
shape: undefined,
data: undefined,
[cause]: TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11413:11) {
cause: RequestContentLengthMismatchError: Request body length does not match content-length header
at AsyncWriter.end (node:internal/deps/undici/undici:10197:19)
at writeIterable (node:internal/deps/undici/undici:10107:16)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
}
}
}
TRPCClientError: fetch failed
at TRPCClientError.from (file:///var/task/node_modules/@trpc/client/dist/transformResult-9a244fe7.mjs:13:16)
at file:///var/task/node_modules/@trpc/client/dist/links/httpBatchLink.mjs:211:64 {
meta: undefined,
shape: undefined,
data: undefined,
[cause]: TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11413:11) {
cause: RequestContentLengthMismatchError: Request body length does not match content-length header
at AsyncWriter.end (node:internal/deps/undici/undici:10197:19)
at writeIterable (node:internal/deps/undici/undici:10107:16)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
}
}
}
I've been struggling for a while, and have no clue what's going on. Anybody experienced something similar? It seems to be coming from undici polyfilling fetch for node, but that's as far as I can go before the guessing game begins. This is not happening locally
2 replies