Sentry TRPC config not working

I followed this guide on integrating sentry into a t3 app (both frontend and backend) https://github.com/getsentry/sentry-javascript/discussions/8500 My frontend errors are properly getting caught, but sentry is not intercepting my backend errors. Does anyone have any ideas on how to progress? I would love for sentry to just automatically catch all errors originating from my trpc routes
GitHub
Integrating Sentry with the t3 stack · getsentry sentry-javascript ...
This is a small guide on how to integrate Sentry with https://create.t3.gg/. A code repo of the guide can be found here: https://github.com/AbhiPrasad/sentry-t3-app Was initially requested here. In...
1 Reply
BigLung
BigLung10mo ago
Error: Error sending test text message
at eval (webpack-internal:///(api)/./src/server/api/routers/message.ts:78:19)
at resolveMiddleware (file:///home/andrew/Github/river/web/node_modules/@trpc/server/dist/index.mjs:417:36)
at callRecursive (file:///home/andrew/Github/river/web/node_modules/@trpc/server/dist/index.mjs:453:38)
at next (file:///home/andrew/Github/river/web/node_modules/@trpc/server/dist/index.mjs:462:32)
at inputMiddleware (file:///home/andrew/Github/river/web/node_modules/@trpc/server/dist/index.mjs:287:16)
at async callRecursive (file:///home/andrew/Github/river/web/node_modules/@trpc/server/dist/index.mjs:453:32)
at async callRecursive (file:///home/andrew/Github/river/web/node_modules/@trpc/server/dist/index.mjs:453:32)
at async callRecursive (file:///home/andrew/Github/river/web/node_modules/@trpc/server/dist/index.mjs:453:32)
at async resolve (file:///home/andrew/Github/river/web/node_modules/@trpc/server/dist/index.mjs:483:24)
at async inputToProcedureCall (file:///home/andrew/Github/river/web/node_modules/@trpc/server/dist/resolveHTTPResponse-3aef2178.mjs:46:22)
at async Promise.all (index 0)
at async resolveHTTPResponse (file:///home/andrew/Github/river/web/node_modules/@trpc/server/dist/resolveHTTPResponse-3aef2178.mjs:173:37)
at async file:///home/andrew/Github/river/web/node_modules/@trpc/server/dist/nodeHTTPRequestHandler-842a1461.mjs:67:9
at async file:///home/andrew/Github/river/web/node_modules/@trpc/server/dist/adapters/next.mjs:44:9
at async /home/andrew/Github/river/web/node_modules/@sentry/nextjs/cjs/common/wrapApiHandlerWithSentry.js:138:35
Error: Error sending test text message
at eval (webpack-internal:///(api)/./src/server/api/routers/message.ts:78:19)
at resolveMiddleware (file:///home/andrew/Github/river/web/node_modules/@trpc/server/dist/index.mjs:417:36)
at callRecursive (file:///home/andrew/Github/river/web/node_modules/@trpc/server/dist/index.mjs:453:38)
at next (file:///home/andrew/Github/river/web/node_modules/@trpc/server/dist/index.mjs:462:32)
at inputMiddleware (file:///home/andrew/Github/river/web/node_modules/@trpc/server/dist/index.mjs:287:16)
at async callRecursive (file:///home/andrew/Github/river/web/node_modules/@trpc/server/dist/index.mjs:453:32)
at async callRecursive (file:///home/andrew/Github/river/web/node_modules/@trpc/server/dist/index.mjs:453:32)
at async callRecursive (file:///home/andrew/Github/river/web/node_modules/@trpc/server/dist/index.mjs:453:32)
at async resolve (file:///home/andrew/Github/river/web/node_modules/@trpc/server/dist/index.mjs:483:24)
at async inputToProcedureCall (file:///home/andrew/Github/river/web/node_modules/@trpc/server/dist/resolveHTTPResponse-3aef2178.mjs:46:22)
at async Promise.all (index 0)
at async resolveHTTPResponse (file:///home/andrew/Github/river/web/node_modules/@trpc/server/dist/resolveHTTPResponse-3aef2178.mjs:173:37)
at async file:///home/andrew/Github/river/web/node_modules/@trpc/server/dist/nodeHTTPRequestHandler-842a1461.mjs:67:9
at async file:///home/andrew/Github/river/web/node_modules/@trpc/server/dist/adapters/next.mjs:44:9
at async /home/andrew/Github/river/web/node_modules/@sentry/nextjs/cjs/common/wrapApiHandlerWithSentry.js:138:35
Console logs... Where I originate the error...
testTextMessage: protectedProcedure
.input(
z.object({
phoneNumber: z.string(),
})
)
.mutation(async ({ ctx, input }): Promise<boolean> => {
try {
throw new Error("Error sending test text message");
await sendText(
input.phoneNumber,
env.TWILIO_PHONE_NUMBER,
"Hey Andrew how are you doing? REPLY STOP TO OPT OUT. "
);
return true;
} catch (e) {
console.error(e);
return false;
}
}),
testTextMessage: protectedProcedure
.input(
z.object({
phoneNumber: z.string(),
})
)
.mutation(async ({ ctx, input }): Promise<boolean> => {
try {
throw new Error("Error sending test text message");
await sendText(
input.phoneNumber,
env.TWILIO_PHONE_NUMBER,
"Hey Andrew how are you doing? REPLY STOP TO OPT OUT. "
);
return true;
} catch (e) {
console.error(e);
return false;
}
}),