1
votes

I wanted to get started with some typescript but now I can't even compile one line of code.

Here is my code:

/// <reference path='jquery.d.ts' />

var test : String = "test";

When I try to run tsc myFile.ts I get 500 compile errors. Basically every line in the jquery.d.ts file is an error.

I used the most recent version of jquery from https://typescript.codeplex.com/SourceControl/latest#typings/jquery.d.ts

What is going on?

1
Actually you should get 'jquery.d.ts' from here: github.com/borisyankov/DefinitelyTyped/blob/master/jquery/… - BrunoLM
Your code works on the playground. My guess is that your .d.ts file contains invalid characters or something. - BrunoLM
Thanks. I thought I checked that. - Marc HPunkt
@BrunoLM that should be the answer :) - basarat

1 Answers

0
votes

You have probably included the .ts file in you HTML file, but you should include the .js file. I've written a blog about common Typescript mistakes.