0

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>.

7
  • It can be some script you're loading before this one that has a missing semicolon or closing bracket. Commented Jun 26, 2014 at 14:01
  • @MelanciaUK I only have one file before loading jQuery, and it works fine without /// <reference path="jquery.d.ts" /> Commented Jun 26, 2014 at 14:03
  • 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 Commented Jun 26, 2014 at 14:03
  • @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. Commented Jun 26, 2014 at 14:17
  • @OlleHärstedt Oh, maybe redownload that file and see if makes a difference. Did you minify it or edit it at all? Commented Jun 26, 2014 at 14:20

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.