A colleague mailed me the following error message when using TypeScript and the ‘import’ syntax to load module:
error TS1147: Import declarations in a namespace cannot reference a module.
Here is the related code. The error was thrown on the import statement:
We found the solution quickly. After moving the ‘import’ statements outside the module, the error disappeared: