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
Under "moduleResolution": "Node16" (or "NodeNext"), compilation of TypeScript types for the router can fail with error
TS2742: The inferred type of 'appRouter' cannot be named without a reference to '../node_modules/@trpc/server/dist/core/internals/config.js'. This is likely not portable. A type annotation is necessary.
Provide environment information
Local machine:
¯\_(ツ)_/¯
Stackblitz repro:
Describe the bug
Under
"moduleResolution": "Node16"
(or"NodeNext"
), compilation of TypeScript types for the router can fail with errorLink to reproduction
https://stackblitz.com/edit/trpc-server-inferred-type-cannot-be-named?file=src%2Findex.ts&view=editor
To reproduce
See repro:
"moduleResolution": "Node16"
tsc --declaration
Additional information
Related issues:
Tried several suggested solutions (e.g. mentioned here); none worked, or had undesired side-effects.
The same issue exists in 9.x (after having manually worked around the module resolution).
👨👧👦 Contributing
The text was updated successfully, but these errors were encountered: