Issue with Effect Reading Request Body in Next.js Application
In a Next Application, if we take this code as reference rpc, there is an issue when Effect read the body, I'll try a standalone repro:
⨯ (FiberFailure) RequestError: Transport error (POST http://localhost:3000/api/effect/messagerie/)
at catch (file:///Users/titouancreach/Projets/Aexmed/app/apps/app/.next/server/chunks/ssr/1a500_@effect_platform_dist_esm_599cfe52._.js:2194:29)
at file:///Users/titouancreach/Projets/Aexmed/app/apps/app/.next/server/chunks/ssr/f32d8_effect_dist_esm_internal_core-effect_ca320d4a.js:643:260
at http.client POST
at RpcClient.RecupererMessagesReq {
[cause]: TypeError: fetch failed
at node:internal/deps/undici/undici:13392:13
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
[cause]: TypeError: Cannot perform ArrayBuffer.prototype.slice on a detached ArrayBuffer
at ArrayBuffer.slice (<anonymous>)
at extractBody (node:internal/deps/undici/undici:5458:47)
at safelyExtractBody (node:internal/deps/undici/undici:5565:14)
at httpRedirectFetch (node:internal/deps/undici/undici:10730:24)
at httpFetch (node:internal/deps/undici/undici:10673:28)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async node:internal/deps/undici/undici:10410:20
at async mainFetch (node:internal/deps/undici/undici:10400:20)
}
} ⨯ (FiberFailure) RequestError: Transport error (POST http://localhost:3000/api/effect/messagerie/)
at catch (file:///Users/titouancreach/Projets/Aexmed/app/apps/app/.next/server/chunks/ssr/1a500_@effect_platform_dist_esm_599cfe52._.js:2194:29)
at file:///Users/titouancreach/Projets/Aexmed/app/apps/app/.next/server/chunks/ssr/f32d8_effect_dist_esm_internal_core-effect_ca320d4a.js:643:260
at http.client POST
at RpcClient.RecupererMessagesReq {
[cause]: TypeError: fetch failed
at node:internal/deps/undici/undici:13392:13
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
[cause]: TypeError: Cannot perform ArrayBuffer.prototype.slice on a detached ArrayBuffer
at ArrayBuffer.slice (<anonymous>)
at extractBody (node:internal/deps/undici/undici:5458:47)
at safelyExtractBody (node:internal/deps/undici/undici:5565:14)
at httpRedirectFetch (node:internal/deps/undici/undici:10730:24)
at httpFetch (node:internal/deps/undici/undici:10673:28)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async node:internal/deps/undici/undici:10410:20
at async mainFetch (node:internal/deps/undici/undici:10400:20)
}
}