Skip to content
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

"Inferred type cannot be named" error caused by adding paths to tsconfig #57802

Closed
haines opened this issue Mar 16, 2024 · 0 comments Β· Fixed by #57973
Closed

"Inferred type cannot be named" error caused by adding paths to tsconfig #57802

haines opened this issue Mar 16, 2024 · 0 comments Β· Fixed by #57973
Assignees
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue Needs Investigation This issue needs a team member to investigate its status.

Comments

@haines
Copy link

haines commented Mar 16, 2024

πŸ”Ž Search Terms

"inferred type cannot be named", "paths"

πŸ•— Version & Regression Information

⏯ Playground Link

https://github.com/haines/typescript-paths-inferred-type-cannot-be-named

πŸ’» Code

Please see the linked repo (sorry, I couldn't reduce it any further).

πŸ™ Actual behavior

In a multiproject build where app depends on lib, setting paths in lib's tsconfig breaks app's build with

error TS2742: The inferred type of '...' cannot be named without a reference to '...'. This is likely not portable. A type annotation is necessary.

πŸ™‚ Expected behavior

Adding paths shouldn't break the dependent project.

Additional information about the issue

Judging by the PR that I was able to bisect to, this seems like it could a bad interaction between paths in tsconfig.json and exports in package.json.

@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label Mar 19, 2024
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 5.5.0 milestone Mar 19, 2024
@typescript-bot typescript-bot added the Fix Available A PR has been opened for this issue label Mar 28, 2024
@DanielRosenwasser DanielRosenwasser added the Bug A bug in TypeScript label Mar 28, 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 Fix Available A PR has been opened for this issue Needs Investigation This issue needs a team member to investigate its status.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants