question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Type error in @trpc/server with TS 4.6

See original GitHub issue

Hi @KATT,
Thank you for this great library.

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' in type '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

image

Best regards

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
ArnaudBarrecommented, May 3, 2022

For people running into this (skipLibCheck strangely doesn’t work), change lib option in tsconfig to ES2021 (instead of ESNext/ES2022)

1reaction
KATTcommented, Mar 2, 2022

You probably want to enable skipLibCheck. I’ll have a look at this when I can

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrade to TypeScript `4.6` · Issue #1600 · trpc/trpc
The project builds fine when updating the typescript-version, but there is some issue introduced in 4.5 that stops one of the tests. See...
Read more >
Documentation - TypeScript 4.6
In TypeScript, it was previously an error to contain any code at the beginning of a constructor if its containing class had any...
Read more >
TypeScript 4.6 Beta Improves Type Inference and Error ...
In TypeScript, it was previously an error to contain any code at the beginning of a constructor if its containing class had any...
Read more >
TypeScript 4.6.4 is indicating that this code is not valid
Type 'null' is not assignable to type 'string'. I added the // @ts-ignore but WebStorm is complaining that there is an error. javascript ......
Read more >
TypeScript errors and how to fix them
error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'. Broken Code...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found