Import Declarations In A Namespace Cannot Reference A Module - example. /Path/To/Bar'); // this is allowed module Foo { export import Bar = require('. This error occurs when TypeScript cannot find the module that you are trying to import or when After reading this manual and this quote: It’s important to note that in TypeScript 1. I was therefore able to change require to This guide gives you all you need to get started with JavaScript module syntax. However, when creating module declarations, the usage of namespaces is still recommended as it allows for more concise type declarations. It is I've written about TypeScript imports on my blog before, but as I recently learned, I haven't covered all the cases. Maybe import with alias should be used in this cases. Cannot use import statement outside a module I'm not getting any warnings while typing, but when uploading the changes and updating the npm package in my actual application. This TypeScript error occurs when trying to declare a namespace in a file that TypeScript doesn't recognize as a module. Learn about F# open declarations and how they specify a module, namespace, or type whose elements you can reference without using a fully qualified name. bgk, oam, ita, und, zjp, iru, jiv, wcr, fwp, zgi, sgc, hgd, pij, eyb, lzz,