0

I have a ng2 website I upgraded to ng4. On building, I get an error

ERROR in /home/docker/urlmgr-client/node_modules/@angular/core/src/change_detection/differs/iterable_differs.d.ts

(15,48): error TS2304: Cannot find name 'Iterable'.

It is the only error and I never got this error in ng2.

I'm not sure where to begin debugging this. Any help would be appreciated.

DFBerry
  • 1,818
  • 1
  • 19
  • 37
  • Looks like a dependency error to me. With [npm-check-updates](https://www.npmjs.com/package/npm-check-updates) you can easily check and update your dependencies after upgrading from Angular 2. – Ploppy Apr 05 '17 at 22:24
  • How is it a dependency error if it is in angular core? The offending line in the file is" export declare type NgIterable = Array | Iterable;" – DFBerry Apr 05 '17 at 22:28
  • I updated via npm-check-updates but still have the error. – DFBerry Apr 05 '17 at 22:38
  • I added the following to the top of the file and it compiles now- "declare type Iterable = any;" – DFBerry Apr 05 '17 at 22:46
  • Glad you figured it out =) – Ploppy Apr 05 '17 at 22:47

1 Answers1

1

I had the same issue, it is due to having a file left over from Angular 2. You will need to delete the node_modules folder and reinstall Angular.

Adding "export declare type NgIterable = Array | Iterable" is completely unnecessary.

Steverob2k
  • 445
  • 8
  • 11
  • Thanks for letting me know. I will give it a try. – DFBerry Apr 28 '17 at 18:10
  • Thank you so much; this saved me. I was in a panic as I'm not that familiar with all the crap angular loads in that folder. Whew, and upvoted. Should definitely be marked as the answer. – BinaryPatrick Jul 14 '17 at 18:01