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

Package main typings resolution is not consistent with normal resolution #9854

Closed
unional opened this issue Jul 21, 2016 · 4 comments
Closed
Labels
Fixed A PR has been merged for this issue Help Wanted You can do this Suggestion An idea for TypeScript

Comments

@unional
Copy link
Contributor

unional commented Jul 21, 2016

Don't know if this is intentional or is an unintended bug.

Currently if package.json/typings property is not specified, it defaults to read /index.d.ts, even if package.json/main is specified as things like dist/index.js.

In contrast, normal (relative) resolution would look for .d.ts next to the .js file.

Should tsc also tries to look up dist/index.d.ts in the above case?

This applies to 1.8 and 2.0.

Original conversation:
blakeembrey/make-error-cause#12

@mhegazy
Copy link
Contributor

mhegazy commented Jul 22, 2016

i am sure there was an issue tracking this. but could not find it.

@just-boris
Copy link

just-boris commented Jan 17, 2019

This issue seems to be resolved starting from Typescript 2.9.

I have found the respective logic in the code, but could not track when was exactly this implemented. Trying to build my project that does not have typings field, only main, I confirm, that the issue happens in typescript 2.8, but I do not see this in newer versions.

@unional can you re-check, please?

@unional
Copy link
Contributor Author

unional commented Jan 17, 2019

Yes, I think it is fixed. Tested in 3.2.2
👍 🌷

@sheetalkamat
Copy link
Member

I believe this is fixed by #24112

@sheetalkamat sheetalkamat added the Fixed A PR has been merged for this issue label Jan 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed A PR has been merged for this issue Help Wanted You can do this Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants