0

I have project recently upgraded from angular 9 to 11,

Works fine on my desktop. When I pulled project from repo to my laptop (which was used with verions 9), I keep getting errors below when trying to compile. I updated global Angular CLI to 11.2.11 (the project is on 11.2.2) and Typescript to 4.1.5.

This is the error:

Your global Angular CLI version (11.2.11) is greater than your local version (11.2.2). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
Building Angular Package
******************************************************************************   
It is not recommended to publish Ivy libraries to NPM repositories.
Read more here: https://v9.angular.io/guide/ivy#maintaining-library-compatibility
******************************************************************************   

------------------------------------------------------------------------------
Building entry point 'nine-gold-lib'
------------------------------------------------------------------------------
⠙ Compiling TypeScript sources through NGCCompiling @angular/core : es2015 as esm2015
Error: Error on worker #1: TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
    at __read (C:\Users\fwitk\Documents\GitHub\ninegoldplatform\node_modules\tslib\tslib.js:174:50)
    at Object.__spread (C:\Users\fwitk\Documents\GitHub\ninegoldplatform\node_modules\tslib\tslib.js:193:28)
    at Renderer.renderAdjacentStatements (C:\Users\fwitk\Documents\GitHub\ninegoldplatform\node_modules\@angular\compiler-cli\ngcc\src\rendering\renderer.js:159:63)
    at C:\Users\fwitk\Documents\GitHub\ninegoldplatform\node_modules\@angular\compiler-cli\ngcc\src\rendering\renderer.js:80:52
    at Array.forEach (<anonymous>)
    at Renderer.renderFile (C:\Users\fwitk\Documents\GitHub\ninegoldplatform\node_modules\@angular\compiler-cli\ngcc\src\rendering\renderer.js:76:46)       
    at C:\Users\fwitk\Documents\GitHub\ninegoldplatform\node_modules\@angular\compiler-cli\ngcc\src\rendering\renderer.js:53:84
    at Array.forEach (<anonymous>)
    at Renderer.renderProgram (C:\Users\fwitk\Documents\GitHub\ninegoldplatform\node_modules\@angular\compiler-cli\ngcc\src\rendering\renderer.js:48:54)    
    at Transformer.transform (C:\Users\fwitk\Documents\GitHub\ninegoldplatform\node_modules\@angular\compiler-cli\ngcc\src\packages\transformer.js:84:42)   
    at ClusterMaster.onWorkerMessage (C:\Users\fwitk\Documents\GitHub\ninegoldplatform\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:195:27)
    at C:\Users\fwitk\Documents\GitHub\ninegoldplatform\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:55:95
    at ClusterMaster.<anonymous> (C:\Users\fwitk\Documents\GitHub\ninegoldplatform\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:293:57)
    at step (C:\Users\fwitk\Documents\GitHub\ninegoldplatform\node_modules\tslib\tslib.js:143:27)
    at Object.next (C:\Users\fwitk\Documents\GitHub\ninegoldplatform\node_modules\tslib\tslib.js:124:57)
    at C:\Users\fwitk\Documents\GitHub\ninegoldplatform\node_modules\tslib\tslib.js:117:75
    at new Promise (<anonymous>)
    at Object.__awaiter (C:\Users\fwitk\Documents\GitHub\ninegoldplatform\node_modules\tslib\tslib.js:113:16)
    at EventEmitter.<anonymous> (C:\Users\fwitk\Documents\GitHub\ninegoldplatform\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:287:32)
    at EventEmitter.emit (events.js:315:20)
× Compiling TypeScript sources through NGC
ERROR: NGCC failed.
13
  • Have you directly update angular version from 9 to 11 ? if Yes, then first you have to update project from version 9 to 10 and then version 10 to 11. Do not directly skip one major version when updating. Commented May 1, 2021 at 6:11
  • and double check in nine-gold-lib, every directives, pipes, services or components are exported too! if anything you had not exported from library and used it within you own module, then ivy will fail to compile library. Commented May 1, 2021 at 6:22
  • I did the update a few weeks ago on different machine. Did to 10 and then to 11. There were a few issues with libraries versions and it was resolved and package json has all the updates. Now on second machine I pulled the code from repo. I reinstalled on libraries on the project, but still getting these errors. Commented May 1, 2021 at 7:53
  • 1
    Sorry @GaurangDhorda I was out, for some reason tslib was not updating based on package.json config, I had to do it manually. Commented May 5, 2021 at 8:00
  • 1
    I have also UpVote your answer. :) Commented May 5, 2021 at 8:07

1 Answer 1

1

The issue was with tslib version not updating based on package.json; after manual update the error disappeared.

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

1 Comment

What you update and how did you resolved that? Can you please explain more why is this happening?

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.