UPDATE: The problem I had at that time was due to a bug in VS / Typescript. This issue is now resolved. Currently, the only reason for this error to occur is the lack of module type selection in Typescript properties. See Accepted Answer.
VS 15: MVC asp.net project.
I am adding a Typescript file. Then I install the module system into the system.
Then I create a project.
An error occurs: it is not possible to compile modules if the -module flag is not specified.
Then I check the properties of the ts file. I set the assembly action to none. The error will disappear.
However, if I start with a new Typescript project using a template with the Greeter class, then everything will work as expected.
But I carefully studied the project settings, and I do not see the differences.
I read all the other answers to this error, and none of them resolved the error.
The only workaround I found was to set โCompile on Saveโ to true, and then set the build action to โNoโ
source share