-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Unique compiler warning for libraries without type information #11060
Comments
This has been the same message since 0.9.*. Looks like there was a file that 1.8 picked up that is not picked up now. where was your module declared without installing @types? if you run
The thing is the compiler is only looking for the type information all the time. it looks for a |
I had
Its probably my understanding of how TypeScript works (still finding my feet), but if I have a typo in my
That seems like the right error for that kind of issue to me - it can't find that module in the What confused me is that the compiler is emitting the same error for the case where the module isn't present as when there is no typing information for that module. Perhaps internally they are the same thing, but externally its two different npm modules to install and the compiler doesn't offer any indication as to which one is missing. Kudos on the 2.0 release btw - I'm loving TypeScript :-) |
from the compiler perspective it does not make a difference. it only looks for a module Module resoluton documentation might be helpful here: http://www.typescriptlang.org/docs/handbook/module-resolution.html
I suppose we can do one pass after we find the error to see if a .js file exists somewhere, and issue a follow up message if only the declaration file is missing. |
TypeScript Version: 2.0.2 && 2.1.0-dev.20160922
Code
Import a npm sourced module which you haven't installed an
@type/
definition for.Expected behavior:
Compiler warning that it couldn't find typing information for the module.
Actual behavior:
Compiler warning saying that it can't find the module:
2.0.0 didn't have this behaviour, then which I upgraded to 2.0.2 I started getting errors about modules which I knew I had npm installed not existing. It took a while to realise that the issue was tsc didn't have the
@type
definitions for those modules.It would be really useful to have the compiler's warning change for such a case - for example:
This isn't a bug report as such, as its all working, but rather a request that the information emitted by the compiler be clearer.
The text was updated successfully, but these errors were encountered: