-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v7.80.0 breaks tRPC middleware handler (Typescript) #9536
Comments
Hi, I messed this up and we will fix this. In the meanwhile you should just be able to cast to const sentryMiddleware = middleware(
// 1.
Handlers.trpcMiddleware({
attachRpcInput: false,
- }),
+ }) as any,
); |
Hey @lforst ! I updated @sentry/node and @sentry/nextjs to const sentryMiddleware = t.middleware(
Sentry.Handlers.trpcMiddleware({
attachRpcInput: true,
}) as any
);
export const publicProcedure = t.procedure
.use(sentryMiddleware)
.use(rateLimitMiddleware); yarn list @sentry/*
yarn list v1.22.19
warning Filtering by arguments is deprecated. Please use the pattern option instead.
├─ @sentry/browser@7.80.1
├─ @sentry/cli@1.76.0
├─ @sentry/core@7.80.1
├─ @sentry/integrations@7.80.1
├─ @sentry/nextjs@7.80.1
├─ @sentry/node@7.80.1
├─ @sentry/react@7.80.1
├─ @sentry/replay@7.80.1
├─ @sentry/types@7.80.1
├─ @sentry/utils@7.80.1
├─ @sentry/vercel-edge@7.80.1
└─ @sentry/webpack-plugin@1.20.0
Done in 4.03s. |
I'm still testing, but i think that this workaround is working: const sentryMiddleware = t.middleware(async (opts) => {
const middleware = Sentry.Handlers.trpcMiddleware({
attachRpcInput: true,
});
return middleware(opts);
}); |
@GuilhermeCunha Weird, the issue is fixed for my project. Would you mind creating a small reproduction example so that we can debug this more effectively? Thanks! |
Do we have one codesandbox template do to this, or should I create one repository from the ground? |
@GuilhermeCunha please create a new one. Thank you! |
Hey, this is most probably a regression in the most recent patch version of tRPC. |
I believe this should be fixed by upgrading trpc! Let me know if you still face issues. |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
7.80.0
Framework Version
No response
Link to Sentry event
No response
SDK Setup
The following downgrade of all dependencies worked, the combination of all latest doesnt:
Here is my trpc setup:
Depending on which combination of versions i tried, no. 1 had a type error (the middleware is now async), or no. 2 had the wrong context. Swapping the Auth middleware with Sentry had a similar result (type errors)
Steps to Reproduce
Expected Result
No Type errors, project compiles
Actual Result
The text was updated successfully, but these errors were encountered: