You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No error for importing unknown module using import "mod" syntax #4561
Breaking ChangeWould introduce errors in existing codeBugA bug in TypeScriptWon't FixThe severity and priority of this issue do not warrant the time or complexity needed to fix it
If ES loaders are definable at runtime, how can we suppose to know how an import is going to resolve? Are we just going to try to (simultaneously) support the Browser loader and the Node loaders? Or can we provide a facility for describing how a loader resolves a module name and finds the code associated with it?
the compiler emulates the resolution loigic for imports in general. so import d from "myPackage" will resolve to node_modules\myPackage\index.d.ts assuming you are using CommonJs, and will give you an error if you are using AMD/UMD/SystemJS.
the issue is our error reporting now depends on the typechecker needing the module symbol to check something against it. in the case of import "mod" the symbol is never needed, so the checking never happens.
Breaking ChangeWould introduce errors in existing codeBugA bug in TypeScriptWon't FixThe severity and priority of this issue do not warrant the time or complexity needed to fix it
Activity
weswigham commentedon Aug 31, 2015
If ES loaders are definable at runtime, how can we suppose to know how an
importis going to resolve? Are we just going to try to (simultaneously) support theBrowserloader and theNodeloaders? Or can we provide a facility for describing how a loader resolves a module name and finds the code associated with it?mhegazy commentedon Aug 31, 2015
the compiler emulates the resolution loigic for imports in general. so
import d from "myPackage"will resolve tonode_modules\myPackage\index.d.tsassuming you are using CommonJs, and will give you an error if you are using AMD/UMD/SystemJS.the issue is our error reporting now depends on the typechecker needing the module symbol to check something against it. in the case of
import "mod"the symbol is never needed, so the checking never happens.mhegazy commentedon Sep 18, 2015
Avoid the breaking change, and the current behavior is not impacting correctness.