Tim
Tim

Reputation: 3038

Typescript compile error

I downloaded a definition of dojo from github, but on compile I get this exception.

tsc.js(3228, 17) Microsoft JScript runtime error: Argument out of range: position.

Is this Typescript (using 0.9.0.1 atm) falling over on the size of the file? Its almost 800kb.

Thanks.

Upvotes: 0

Views: 131

Answers (2)

I got the same error and resolved it by renaming my class which have the same name as a module.

export Class A{
    ....
}
export module A{
    ....
}
class B extends A{ // here compiler thinks that A is module not class A

}

Upvotes: 0

Jeffery Grajkowski
Jeffery Grajkowski

Reputation: 4061

I don't think it's a file size problem because I use a very similar declaration file without issues, but it is a compiler issue for sure.

That declaration file and my own are both based on output from the DojoTypeScriptConverter. I wish I could share my own with you but it's for work so I don't have the liberty. Maybe you'll have more luck going back to the base version there and modifying as necessary.

Another project you should look into is Dojo-TypeScript. This supports dojo >= 1.7 while the other only goes up to 1.6. I haven't used it because there's no declarations for the deprecated features I need, but it looks promising.

Upvotes: 1

Related Questions