`$extends` TS error: "Inferred type of this node exceeds the maximum length the compiler will serialize" with `"declaration": true` in `tsconfig`
See original GitHub issueThe inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.
This error also showed up in another project.
Source file. To reproduce, check out main, and upgrade to Prisma 4.7
Issue Analytics
- State:
- Created 10 months ago
- Reactions:2
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Typescript: "The inferred type of this node exceeds the ...
"The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed." This was working ......
Read more >TSConfig Reference - Docs on every TSConfig option
An error occurs if any of the files can't be found. {. " compilerOptions ": {},. " files ": [. "core.ts",. "sys.ts",. "types.ts",....
Read more >Prisma 4.8.0 Release - GitClear
Prisma 4.3. · enum fields are missing in select's type when clientExtensions preview feature is used · $extends TS error: "Inferred type of...
Read more >Zod | Documentation
Zod is a TypeScript-first schema declaration and validation library. I'm using the term "schema" to broadly refer to any data type, from a...
Read more >TypeScript: src/compiler/diagnosticMessages.json - Fossies
{ 187 "category": "Error", 188 "code": 1061 189 }, 190 "Type is referenced ... 1023 "'infer' declarations are only permitted in the 'extends'...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @mshd and thank you for your report! This error is related to failure to emit declarations — notice that despite the error, if you hover the mouse over the variable in your editor, you can still see that TypeScript infers a type. Adding
to
tsconfig.json
prevents the issue, so this is the workaround for now. We will work on investigating and fixing the root cause, as of course the functionality should work regardless of this compiler option. Thanks for bringing this to our attention.@millsp I think it’s only related to declaration: true. @aqrln Thanks so much, this solved it for now. @miguelff By using your repro.zip and adding declaration: true in tsconfig.json, you can reproduce the error.