Monday, December 12, 2016

error TS1147: Import declarations in a namespace cannot reference a module.

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:

1 comment:

Padhma said...

this declaration module will be useful for me,thnks for sharing
Back to original