After upgrading to Angular2.beta6 getting "error TS2339: Property '...' does not exist on type ..."

1,147 views
Skip to first unread message

JG

unread,
Feb 12, 2016, 5:01:07 PM2/12/16
to AngularJS
After upgrading to beta 6 I started getting error messages when transpiling from TypeScript to ES5. It seem to affect ES6 methods of Array. One example would be:
xxxxx.ts(347,49): error TS2339: Property 'findIndex' does not exist on type 'Xxxxxx[]'.

I was getting more errors until I added ///<reference path="../../node_modules/angular2/typings/browser.d.ts"/> at the top of the .ts file doing bootstrapping.

Stalin Pereira

unread,
Feb 13, 2016, 6:46:57 AM2/13/16
to AngularJS
I am also having the same issue.

Günter Zöchbauer

unread,
Feb 13, 2016, 9:20:40 AM2/13/16
to AngularJS
Check the Angular2 GitHub issues https://github.com/angular/angular

JG

unread,
Feb 15, 2016, 9:31:06 AM2/15/16
to AngularJS
I did see your link, thank you. I didn't find this issue addressed there. Is there a more specific link that you could share?

JG

unread,
Feb 15, 2016, 9:35:13 AM2/15/16
to AngularJS
It seems that all that is necessary here is to add typing for es6 shim. The change log for beta 6 says "... If you rely on es6 APIs other than Promises and Collections, you will need to install the es6-shim typing instead of using the tag above." The question is: where to get the es6-shim typing?

JG

unread,
Feb 15, 2016, 9:48:25 AM2/15/16
to AngularJS
Solved.
Go to https://github.com/DefinitelyTyped/DefinitelyTyped/blob/ffceea9dd124d277c4597c7bd12930666ec074c5/es6-shim/es6-shim.d.ts and download the es6-shim.d.ts file. Then add reference to this file (and remove reference to node_modules/angular2/typings/browser.d.ts).


On Friday, February 12, 2016 at 5:01:07 PM UTC-5, JG wrote:
Reply all
Reply to author
Forward
0 new messages