typescript-ruby / typescript-rails

An asset pipeline wrapper for the TypeScript language
MIT License
255 stars 30 forks source link

What version of typescript does this gem compile with? #28

Open amritk opened 9 years ago

amritk commented 9 years ago

If I include jquery.d.ts I get a tonne of unexpected errors:

/Users/amrit/apps/rebuild/app/assets/definitions/typings/jquery/jquery.d.ts(279,59): error TS1005: ',' expected.
/Users/amrit/apps/rebuild/app/assets/definitions/typings/jquery/jquery.d.ts(279,73): error TS1005: '=' expected.
/Users/amrit/apps/rebuild/app/assets/definitions/typings/jquery/jquery.d.ts(279,76): error TS1003: Identifier expected.
/Users/amrit/apps/rebuild/app/assets/definitions/typings/jquery/jquery.d.ts(298,41): error TS1005: ',' expected.
/Users/amrit/apps/rebuild/app/assets/definitions/typings/jquery/jquery.d.ts(298,63): error TS1005: '=' expected.
/Users/amrit/apps/rebuild/app/assets/definitions/typings/jquery/jquery.d.ts(298,117): error TS1005: '>' expected.
/Users/amrit/apps/rebuild/app/assets/definitions/typings/jquery/jquery.d.ts(298,139): error TS1005: '=' expected.
/Users/amrit/apps/rebuild/app/assets/definitions/typings/jquery/jquery.d.ts(298,147): error TS1003: Identifier expected.
/Users/amrit/apps/rebuild/app/assets/definitions/typings/jquery/jquery.d.ts(315,56): error TS1005: ',' expected.
/Users/amrit/apps/rebuild/app/assets/definitions/typings/jquery/jquery.d.ts(315,78): error TS1005: '=' expected.
/Users/amrit/apps/rebuild/app/assets/definitions/typings/jquery/jquery.d.ts(315,140): error TS1005: '>' expected.
/Users/amrit/apps/rebuild/app/assets/definitions/typings/jquery/jquery.d.ts(315,162): error TS1005: '=' expected.
/Users/amrit/apps/rebuild/app/assets/definitions/typings/jquery/jquery.d.ts(315,170): error TS1003: Identifier expected.
/Users/amrit/apps/rebuild/app/assets/definitions/typings/jquery/jquery.d.ts(322,50): error TS1005: ',' expected.
/Users/amrit/apps/rebuild/app/assets/definitions/typings/jquery/jquery.d.ts(322,72): error TS1005: '=' expected.
/Users/amrit/apps/rebuild/app/assets/definitions/typings/jquery/jquery.d.ts(322,127): error TS1005: '>' expected.
/Users/amrit/apps/rebuild/app/assets/definitions/typings/jquery/jquery.d.ts(322,149): error TS1005: '=' expected.
/Users/amrit/apps/rebuild/app/assets/definitions/typings/jquery/jquery.d.ts(322,155): error TS1003: Identifier expected.
/Users/amrit/apps/rebuild/app/assets/definitions/typings/jquery/jquery.d.ts(329,52): error TS1005: ',' expected.
/Users/amrit/apps/rebuild/app/assets/definitions/typings/jquery/jquery.d.ts(329,74): error TS1005: '=' expected.
/Users/amrit/apps/rebuild/app/assets/definitions/typings/jquery/jquery.d.ts(329,134): error TS1005: '>' expected.
/Users/amrit/apps/rebuild/app/assets/definitions/typings/jquery/jquery.d.ts(329,156): error TS1005: '=' expected.
/Users/amrit/apps/rebuild/app/assets/definitions/typings/jquery/jquery.d.ts(329,164): error TS1003: Identifier expected.

according to this SO post it means the typescript version is outdated. I am currently using message TS6029: Version 1.5.0-beta and compiling with tsc works fine.

It also blows up when using let

let script : HTMLScriptElement = document.createElement('script');

where var works fine

var script : HTMLScriptElement = document.createElement('script');

Which makes me think this gem is using an older version of typescript, or mine is pointing to the wrong one.

lucacox commented 9 years ago

same error here, version of tsc is message TS6029: Version 1.5.0-beta definitions installed via TSD.

Compiling jquery.d.ts directly gives no error.

I have similar errors on file angular.d.ts too.

jakoss commented 9 years ago

I've found possible solution for our problems. Repository `typescript-ruby-src' that uses local TS node module instead of internal one. It's only pull request since original author seems to abandon repo.

https://github.com/typescript-ruby/typescript-src-ruby/pull/6

amritk commented 9 years ago

You can also check out

https://github.com/typescript-ruby/typescript-node-ruby/issues/5

bdrazhzhov commented 8 years ago

It's updated to v1.6.2. Try it now please.