Skip to content

Incorrectly passing when types missing in package exports #170

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
benasher44 opened this issue May 2, 2024 · 3 comments
Closed

Incorrectly passing when types missing in package exports #170

benasher44 opened this issue May 2, 2024 · 3 comments

Comments

@benasher44
Copy link
Contributor

attw reports highlight-words as passing, but TS can't find the types with moduleResolution set to Bundler. I opened a PR with a fix in tricinel/highlight-words#36, and we're not sure whose right. If attw is right, then I suppose I should file a TS bug?

@benasher44 benasher44 changed the title Incorrectly passing when types missing in exports Incorrectly passing when types missing in package exports May 2, 2024
@andrewbranch
Copy link
Collaborator

It looks like the change in your PR is actually taking advantage of a TS bug, microsoft/TypeScript#50762. Nothing should ever go after default because all resolvers match default and you’re not supposed to try any conditions after matching one, even if the lookup for that condition fails. I’m not sure why attw is passing without that though; I’ll take a look.

@andrewbranch
Copy link
Collaborator

Looking at the trace details on https://arethetypeswrong.github.io/?p=highlight-words%401.2.2, I can’t see anything that looks incorrect. Can you share a repro of it not working in tsc?

@benasher44
Copy link
Contributor Author

Ah you know what. I'm on highlight-words 1.2.1, and types were fixed in 1.2.2 🤦 . Closing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants