Skip to content

5.5.0-dev.20240524 regression on "The inferred type of 'X' cannot be named without a reference" #58710

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

Closed
jgoux opened this issue May 30, 2024 · 2 comments · Fixed by #58720
Closed
Labels
Bug A bug in TypeScript Domain: Declaration Emit The issue relates to the emission of d.ts files Recent Regression This is a new regression just found in the last major/minor version of TypeScript.

Comments

@jgoux
Copy link

jgoux commented May 30, 2024

🔎 Search Terms

cannot be named without a reference

🕗 Version & Regression Information

  • This changed between versions 5.5.0-dev.20240523 and 5.5.0-dev.20240524

I also tried running the latest version 5.5.0-dev.20240530 and the error is still reported.

⏯ Playground Link

No response

💻 Code

This file https://github.com/jgoux/acme/blob/main/apps/api/src/config/trpc.ts is reported with an error that didn't happen before [email protected].

You can try running the type-checking command in the root of the monorepo: pnpm type-check.

🙁 Actual behavior

This error happens:

TS2742: The inferred type of 't' 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.

3 export const t = initTRPC.create();

🙂 Expected behavior

The error shouldn't be reported.

Additional information about the issue

No response

@Andarist
Copy link
Contributor

It would be great if u could post what dts was generated there in 5.4

@jgoux
Copy link
Author

jgoux commented May 30, 2024

It would be great if u could post what dts was generated there in 5.4

Here are the produced dts files for both 5.4.5 and 5.5.0-dev.20240523 (last working version): https://gist.github.com/jgoux/aec06283fb607c1c850ef1c9025af0c4

@weswigham weswigham added Bug A bug in TypeScript Domain: Declaration Emit The issue relates to the emission of d.ts files Recent Regression This is a new regression just found in the last major/minor version of TypeScript. labels May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Declaration Emit The issue relates to the emission of d.ts files Recent Regression This is a new regression just found in the last major/minor version of TypeScript.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants