Definitelytyped: @types/three Cannot find Iterable

Created on 3 Jun 2017  路  7Comments  路  Source: DefinitelyTyped/DefinitelyTyped

  • [ ] I tried using the @types/three package and had problems.
    I tried to write the simplest application using typescript and three.js library. I have installed everything using npm and during compilation I have the following compilation error:

C:\Users\Jacek\documents\visual studio 2015\Projects\NodejsConsoleApp1\NodejsConsoleApp1>tsc app
node_modules/@types/three/three-core.d.ts(767,24): error TS2304: Cannot find name 'Iterable'.
node_modules/@types/three/three-core.d.ts(771,24): error TS2304: Cannot find name 'Iterable'.
node_modules/@types/three/three-core.d.ts(775,24): error TS2304: Cannot find name 'Iterable'.
node_modules/@types/three/three-core.d.ts(779,24): error TS2304: Cannot find name 'Iterable'.
node_modules/@types/three/three-core.d.ts(783,24): error TS2304: Cannot find name 'Iterable'.
node_modules/@types/three/three-core.d.ts(787,24): error TS2304: Cannot find name 'Iterable'.
node_modules/@types/three/three-core.d.ts(791,24): error TS2304: Cannot find name 'Iterable'.
node_modules/@types/three/three-core.d.ts(795,24): error TS2304: Cannot find name 'Iterable'.
node_modules/@types/three/three-core.d.ts(799,24): error TS2304: Cannot find name 'Iterable'.

Could you help me?

Most helpful comment

I tried some of these, but to no avail. I kept getting a Cannot find name 'Iterable' error. What finally worked for me was to install the node typing.

node i --save @types/node

All 7 comments

Try setting --lib es6.

@andy-ms i think you meant --target es6. That's what worked for me.

--target can set --lib as a side effect if you didn't already specify a value. So they would both work.

Thanks for help :)

image
image

I tried some of these, but to no avail. I kept getting a Cannot find name 'Iterable' error. What finally worked for me was to install the node typing.

node i --save @types/node

@JKwasek
add this in your tsconfig.json

"compierOptions" : {
     "lib" : ["es2015", "es2015.iterable", "dom"]
}
Was this page helpful?
0 / 5 - 0 ratings