Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeScript 0.9.* VisualStudio TS5037: Cannot compile external modules unless the '--module' flag is provided

I do get the TypeScript compiler error TS5037: Cannot compile external modules unless the '--module' flag is provided.

I am using TypeScript 0.9.1.1 und Visual Studio 2012.

Where can I set the --module option in Visual Studio?
Web Essential seems to no longer support this option in the dialog.

Thankx, Harry

Update:
I have a configuration file (config.ts) for my project. This file contains many statements as the following:

export var loggedInUserId: number = 0;  

There are no other statements as the one before. Do I have to define a class or module around it?

like image 677
iwhp Avatar asked Aug 24 '13 22:08

iwhp


1 Answers

I was having this problem in Visual Studio 2013, even with that setting above set correctly. It turns out there's a project-level setting as well. If you go to Project Settings on the project with TypeScript (highlight the project and type Alt+Enter), then go to the TypeScript Build tab, and select AMD under "Module System"

enter image description here

like image 98
Nathanael Schulte Avatar answered Sep 18 '22 16:09

Nathanael Schulte