You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am reporting that the server types need updates after the latest typescript release (4.6):
node_modules/@trpc/server/dist/declarations/src/TRPCError.d.ts:7:14 - error TS2416: Property 'cause'intype'TRPCError' is not assignable to the same property in base type'Error'.
Type 'unknown' is not assignable to type'Error | undefined'.
7 readonly cause?: unknown;~~~~~
Found 1 error in node_modules/@trpc/server/dist/declarations/src/TRPCError.d.ts:7
Solved this while working on #1597. The issue is that in es2022 a cause property was added. Not sure how to fix this without doing a breaking change, but we should probably just have our cause type conform to the TypeScript one. Looks like this was a known issue though:
Activity
KATT commentedon Mar 2, 2022
You probably want to enable
skipLibCheck. I'll have a look at this when I cansachinraja commentedon Apr 3, 2022
Solved this while working on #1597. The issue is that in es2022 a
causeproperty was added. Not sure how to fix this without doing a breaking change, but we should probably just have ourcausetype conform to the TypeScript one. Looks like this was a known issue though:trpc/packages/server/src/TRPCError.ts
Lines 25 to 27 in c496ee1
sachinraja commentedon Apr 4, 2022
Fixed on the
nextbranchArnaudBarre commentedon May 3, 2022
For people running into this (skipLibCheck strangely doesn't work), change lib option in tsconfig to ES2021 (instead of ESNext/ES2022)
github-actions commentedon Oct 4, 2022
This issue has been locked because it had no new activity for 14 days. If you are running into a similar issue, please create a new issue. Thank you.