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.

5
  • Looks like a dependency error to me. With npm-check-updates you can easily check and update your dependencies after upgrading from Angular 2. Commented Apr 5, 2017 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<T> = Array<T> | Iterable<T>;" Commented Apr 5, 2017 at 22:28
  • I updated via npm-check-updates but still have the error. Commented Apr 5, 2017 at 22:38
  • I added the following to the top of the file and it compiles now- "declare type Iterable<T> = any;" Commented Apr 5, 2017 at 22:46
  • Glad you figured it out =) Commented Apr 5, 2017 at 22:47

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for letting me know. I will give it a try.
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.