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
Give a better error message when an import isn't found but a namespace of the same name exists #10464
BugA bug in TypeScriptDomain: Error MessagesThe issue relates to error messagingEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".
"foo" won't be found, but if the compiler can resolve an identifier named foo to a namespace that uses the declare module syntax, we should probably give an error like
Cannot find module 'foo'.
A legacy-style namespace with the same name was found.
Try changing the declaration to use quotes (e.g. 'declare module "foo"').
Somewhat skeptical that turning the namespace declaration into an external module declaration is the most likely fix. I feel like people making this error are more likely writing global code and thinking they need to do some incantation to access things across file boundaries
BugA bug in TypeScriptDomain: Error MessagesThe issue relates to error messagingEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".
Activity
RyanCavanaugh commentedon Aug 22, 2016
Somewhat skeptical that turning the namespace declaration into an external module declaration is the most likely fix. I feel like people making this error are more likely writing global code and thinking they need to do some incantation to access things across file boundaries
DanielRosenwasser commentedon Aug 24, 2016
I think as soon as you see an import, you can figure the user is trying to use modules, but I see what you're saying.
RyanCavanaugh commentedon Aug 25, 2026
I don't think we need to do this