The contents of my file, "blah.ts" are
///<reference path="jquery.d.ts">
and that's it.
The file, "jquery.d.ts" is on the same level as "blah.ts".
I copy and pasted jquery.d.ts from here
I installed typescript using npm and it is version 1.3.0.0.
When I run
tsc blah.ts
I get a page of errors
query.d.ts(279,40): error TS1005: ',' expected.
jquery.d.ts(279,61): error TS1005: '=' expected.
jquery.d.ts(279,64): error TS1109: Expression expected.
jquery.d.ts(279,97): error TS1005: ',' expected.
jquery.d.ts(279,118): error TS1005: '=' expected.
jquery.d.ts(279,121): error TS1109: Expression expected.
jquery.d.ts(342,40): error TS1005: ',' expected.
jquery.d.ts(342,61): error TS1005: '=' expected.
jquery.d.ts(342,64): error TS1109: Expression expected.
jquery.d.ts(342,103): error TS1005: ',' expected.
jquery.d.ts(342,124): error TS1005: '=' expected.
jquery.d.ts(342,127): error TS1109: Expression expected.
jquery.d.ts(352,48): error TS1005: ',' expected.
jquery.d.ts(352,69): error TS1005: '=' expected.
jquery.d.ts(352,72): error TS1109: Expression expected.
jquery.d.ts(352,111): error TS1005: ',' expected.
jquery.d.ts(352,132): error TS1005: '=' expected.
jquery.d.ts(352,135): error TS1109: Expression expected.
jquery.d.ts(677,35): error TS1005: ',' expected.
jquery.d.ts(677,36): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(692,39): error TS1005: ',' expected.
jquery.d.ts(692,40): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(722,36): error TS1005: ',' expected.
jquery.d.ts(722,37): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(744,41): error TS1005: ',' expected.
jquery.d.ts(744,42): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(1214,36): error TS1005: ',' expected.
jquery.d.ts(1214,37): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(1255,46): error TS1005: ',' expected.
jquery.d.ts(1311,45): error TS1005: ',' expected.
jquery.d.ts(1311,52): error TS1005: ',' expected.
jquery.d.ts(1383,22): error TS1005: ',' expected.
jquery.d.ts(1383,29): error TS1005: '=' expected.
jquery.d.ts(1404,44): error TS1005: ',' expected.
jquery.d.ts(1411,78): error TS1005: ',' expected.
jquery.d.ts(1428,25): error TS1005: ',' expected.
jquery.d.ts(1434,59): error TS1005: ',' expected.
jquery.d.ts(1446,31): error TS1005: ',' expected.
jquery.d.ts(1458,29): error TS1005: ',' expected.
jquery.d.ts(1489,30): error TS1005: ',' expected.
jquery.d.ts(1503,29): error TS1005: ',' expected.
jquery.d.ts(1541,24): error TS1005: ',' expected.
jquery.d.ts(1547,57): error TS1005: ',' expected.
jquery.d.ts(1615,50): error TS1005: ',' expected.
jquery.d.ts(1615,51): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(1624,50): error TS1005: ',' expected.
jquery.d.ts(1624,51): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(1647,29): error TS1005: ',' expected.
jquery.d.ts(1647,30): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(1655,29): error TS1005: ',' expected.
jquery.d.ts(1655,30): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(1669,30): error TS1005: ',' expected.
jquery.d.ts(1669,31): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(1677,30): error TS1005: ',' expected.
jquery.d.ts(1677,31): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(1692,28): error TS1005: ',' expected.
jquery.d.ts(1701,28): error TS1005: ',' expected.
jquery.d.ts(1709,33): error TS1005: ',' expected.
jquery.d.ts(1709,34): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(1717,33): error TS1005: ',' expected.
jquery.d.ts(1717,34): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(1738,27): error TS1005: ',' expected.
jquery.d.ts(1738,28): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(1746,27): error TS1005: ',' expected.
jquery.d.ts(1746,28): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(1760,27): error TS1005: ',' expected.
jquery.d.ts(1760,28): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(1768,27): error TS1005: ',' expected.
jquery.d.ts(1768,28): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(1782,32): error TS1005: ',' expected.
jquery.d.ts(1782,33): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(1790,32): error TS1005: ',' expected.
jquery.d.ts(1790,33): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(1804,34): error TS1005: ',' expected.
jquery.d.ts(1804,35): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(1812,34): error TS1005: ',' expected.
jquery.d.ts(1812,35): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(1826,30): error TS1005: ',' expected.
jquery.d.ts(1826,31): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(1834,30): error TS1005: ',' expected.
jquery.d.ts(1834,31): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(1864,29): error TS1005: ',' expected.
jquery.d.ts(1864,30): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(1872,29): error TS1005: ',' expected.
jquery.d.ts(1872,30): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(2464,55): error TS1005: ',' expected.
jquery.d.ts(2464,56): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(2471,62): error TS1005: ',' expected.
jquery.d.ts(2471,63): error TS1016: A required parameter cannot follow an optional parameter.
jquery.d.ts(2584,27): error TS1005: ',' expected.
jquery.d.ts(2584,31): error TS1005: '=' expected.
jquery.d.ts(2598,28): error TS1005: ',' expected.
jquery.d.ts(2598,32): error TS1005: '=' expected.
jquery.d.ts(2611,28): error TS1005: ',' expected.
jquery.d.ts(2611,32): error TS1005: '=' expected.
jquery.d.ts(2619,28): error TS1005: ',' expected.
jquery.d.ts(2619,32): error TS1005: '=' expected.
jquery.d.ts(2652,31): error TS1005: ',' expected.
jquery.d.ts(2652,35): error TS1005: '=' expected.
jquery.d.ts(2659,32): error TS1005: ',' expected.
jquery.d.ts(2659,36): error TS1005: '=' expected.
jquery.d.ts(2667,29): error TS1005: ',' expected.
jquery.d.ts(2667,33): error TS1005: '=' expected.
jquery.d.ts(2680,29): error TS1005: ',' expected.
jquery.d.ts(2680,33): error TS1005: '=' expected.
jquery.d.ts(2694,30): error TS1005: ',' expected.
jquery.d.ts(2694,34): error TS1005: '=' expected.
jquery.d.ts(2701,35): error TS1005: ',' expected.
jquery.d.ts(2701,39): error TS1005: '=' expected.
jquery.d.ts(2718,22): error TS1005: ',' expected.
jquery.d.ts(2718,29): error TS1005: ',' expected.
jquery.d.ts(2741,33): error TS1005: ',' expected.
jquery.d.ts(2741,41): error TS1005: ',' expected.
jquery.d.ts(2754,36): error TS1005: ',' expected.
jquery.d.ts(2754,44): error TS1005: ',' expected.
jquery.d.ts(2761,38): error TS1005: ',' expected.
jquery.d.ts(2761,46): error TS1005: ',' expected.
jquery.d.ts(2796,27): error TS1005: ',' expected.
jquery.d.ts(2796,34): error TS1005: ',' expected.
If I don't include jquery, it compiles fine (I did the tutorial and it worked). What is going wrong here?
Version 1.3 is not compatible with this version of jquery.d.ts. I first fixed it by using an old version of jquery.d.ts, then realized I needed to update npm before installing typescript. Installed 1.4 and now it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With