Assertion failed error

I am getting an assertion failed error for some functions I am trying to use, this happens when building the page (I can see this under the javascript -> explorer part) and does not appear as a compilation error.

Basically, one of them is,
testArray:number[] = [0,1,2];

testArray.find(o => o>0)

or with

testArray.find(o => o>5)

I get an assertion error on this.

Can anyone please let me know how to fix this?
I know that it might have to do with o not having a type declaration or that an element is not found so udefined is returned, but how can I fix it?