Error compiling TypeScript Follow
Hi all;
I added --module to the command line for the typescript compiler. Without the --module I get an error message saying it's required.
And now on the code:
export module App.editor.menu {
export class File {
static isOpenEnabled() {
return false;
}
static openClicked() {
debugger;
}
}
}
I get:
"C:/Program Files/nodejs/node_modules/.bin/tsc.cmd" --sourcemap --module menu-handler.ts
warning TS5003: Module code generation 'menu-handler.ts' not supported.
Version 0.9.1.1
Syntax: tsc [options] [file ..]
Examples: tsc hello.ts
tsc --out foo.js foo.ts
tsc @args.txt
Options:
--allowbool Allow 'bool' as a synonym for 'boolean'.
--allowimportmodule Allow 'module(...)' as a synonym for 'require(...)'.
-d, --declaration Generates corresponding .d.ts file
-h, --help Print this message
--mapRoot LOCATION Specifies the location where debugger should locate map files instead of generated locations.
-m KIND, --module KIND Specify module code generation: "commonjs" or "amd"
--noImplicitAny Warn on expressions and declarations with an implied 'any' type.
--noResolve Skip resolution and preprocessing
--out FILE Concatenate and emit output to single file.
--outDir DIRECTORY Redirect output structure to the directory
--removeComments Do not emit comments to output
--sourcemap Generates corresponding .map file
--sourceRoot LOCATION Specifies the location where debugger should locate TypeScript files instead of source locations.
-t VERSION, --target VERSION Specify ECMAScript target version: "ES3" (default), or "ES5"
-v, --version Print the compiler's version: 0.9.1.1
-w, --watch Watch input files
@<file> Insert command line options and files from a file.
Please sign in to leave a comment.
Hi there,
So what is the question here?
Any way... you have:
The help clearly says:
Even the error message says the same (where the error is):
Solution: You should alter your parameters to have either "commonjs" or "amd" AFTER --module option, for example.
I figured this out while I had the question open and never hit submit. It must have auto-saved the question or something.
Anyways, yes the AMD fixed it. If I'm using TypeSctipr, RequireJS, and Ext JS, is AMD the correct kind?
thanks - dave
Sorry, not TypeScript or JavaScript guy :(
yes, it is
:)