0
votes

I get strange compiling errors when using jquery.d.ts:

/var/www/increment_god/jquery.d.ts (165,59): Expected '{'

But line 165 only contains this row:

interface JQueryXHR extends XMLHttpRequest, JQueryPromise<any> {

How to resolve this? I'm using the latest tsc and jquery files. I get similar errors when trying to compile angular.d.ts too.

If I remove <any> from the line above, the next compilation error will be at jQueryPromise<T>.

1
It can be some script you're loading before this one that has a missing semicolon or closing bracket. - melancia
@MelanciaUK I only have one file before loading jQuery, and it works fine without /// <reference path="jquery.d.ts" /> - Olle Härstedt
You are probably missing a curly bracket somewhere in your code. You can start by removing js files or looked at the files you wrote - Huangism
@Huangism I tested and get this error even if jquery.d.ts is the only file I use. Do I use the wrong version of typescript? How do I know? I installed it using npm. - Olle Härstedt
@OlleHärstedt Oh, maybe redownload that file and see if makes a difference. Did you minify it or edit it at all? - Huangism

1 Answers

1
votes

Installed old version of node and typescript without knowing. The old typescript does not support generics, thus the errors.