angular 9 library publish error "Trying to publish a package that has been compiled by Ivy"

Aniruddha Das picture Aniruddha Das · Feb 14, 2020 · Viewed 10.5k times · Source

I migrated my angular 8.x.x project to angular 9.x.x and when I try to publish my library, it fails with below error

npm ERR! @candiman/[email protected] prepublishOnly: node --eval "console.error('ERROR: Trying to publish a package that has been compiled by Ivy. This is not allowed.\nPlease delete and rebuild the package, without compiling with Ivy, before attempting to publish.\n')" && exit 1

is there anything changed in the angular 9

Answer

Aniruddha Das picture Aniruddha Das · Feb 14, 2020

using --prod option while building the library fixed my issue

ng build yourLibraryName --prod