It is not recommended to publish Ivy libraries to NPM repositories

John Peters - Jun 20 '20 - - Dev Community

Okay we get it, all the hype to get to Angular 9 was to get to the new Ivy compiler and renderer. The whole upgrade a veritable total mess with goofy NPM dependency messages and tons of lost time just upgrading.

Meanwhile
We start our merry way trying to create a reusable library only to see this message each time we compile.

The work around is simple:

Before publishing a library to NPM, 
build it using the --prod flag which will
use the older compiler and runtime 
known as View Engine instead of Ivy.
Enter fullscreen mode Exit fullscreen mode

Umm, ok Google, please tell me again the benefits of Ivy? While you're at it, why can't we use Ivy for libraries?

Root Cause

After looking into this a bit, it turns out Angular doesn't want Ivy packages in NPM. I have no idea why. However, this error message is only seen when we type in

ng build
//instead of 
ng build --prod
Enter fullscreen mode Exit fullscreen mode

One last tip, Angular 9 libraries are not compatible with prior versions of Angular. Don't even think of trying it.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player