Teixeira
Teixeira
TtRPC
Created by Teixeira on 2/11/2025 in #❓-help
`FST_ERR_REP_ALREADY_SENT` when using `res.send()`
Oh, that's a bummer 😦 Alright thank you very much
7 replies
TtRPC
Created by Teixeira on 2/11/2025 in #❓-help
`FST_ERR_REP_ALREADY_SENT` when using `res.send()`
which is returning the following error:
[11:02:09.965] WARN (8548): Reply was already sent, did you forget to "return reply" in "/campaigns.generateReport?batch=1" (POST)?
reqId: "req-3"
err: {
"type": "FastifyError",
"message": "Reply was already sent, did you forget to \"return reply\" in \"/campaigns.generateReport?batch=1\" (POST)?",
"stack":
FastifyError: Reply was already sent, did you forget to "return reply" in "/campaigns.generateReport?batch=1" (POST)?
at Reply.send (C:\Users\jpedr\Documents\Workshop\Work\clipx\node_modules\fastify\lib\reply.js:132:26)
at fastifyRequestHandler (file://.../node_modules/@trpc/server/dist/adapters/fastify/fastifyRequestHandler.mjs:43:20)
at Object.<anonymous> (file://.../node_modules/@trpc/server/dist/adapters/fastify/fastifyTRPCPlugin.mjs:29:9)
"code": "FST_ERR_REP_ALREADY_SENT",
"name": "FastifyError",
"statusCode": 500
}
[11:02:09.965] WARN (8548): Reply was already sent, did you forget to "return reply" in "/campaigns.generateReport?batch=1" (POST)?
reqId: "req-3"
err: {
"type": "FastifyError",
"message": "Reply was already sent, did you forget to \"return reply\" in \"/campaigns.generateReport?batch=1\" (POST)?",
"stack":
FastifyError: Reply was already sent, did you forget to "return reply" in "/campaigns.generateReport?batch=1" (POST)?
at Reply.send (C:\Users\jpedr\Documents\Workshop\Work\clipx\node_modules\fastify\lib\reply.js:132:26)
at fastifyRequestHandler (file://.../node_modules/@trpc/server/dist/adapters/fastify/fastifyRequestHandler.mjs:43:20)
at Object.<anonymous> (file://.../node_modules/@trpc/server/dist/adapters/fastify/fastifyTRPCPlugin.mjs:29:9)
"code": "FST_ERR_REP_ALREADY_SENT",
"name": "FastifyError",
"statusCode": 500
}
as far as I am aware I can't return the Buffer directly as it would be resolved to JSON so I have to use res.send. Is there a way I can make the function not attempt to send another reply when it's returning? Using @trpc/server@11.0.0-rc.730+776d07336, fastify@5.2.1, node v22.11.0
7 replies
TtRPC
Created by Teixeira on 1/16/2025 in #❓-help
Route not found when using Fastify adapter
The client side url was missing the /trpc prefix set in the server.
4 replies