Linking an Angular library to an Angular app throws the following error:
core.mjs:6494 ERROR TypeError: Cannot read properties of null (reading 'bindingStartIndex')
at Module.ɵɵelementStart (core:14545:1)
at GreenTextComponent_Template (libs-my-lib.mjs:13:199)
at executeTemplate (core.mjs:9632:1)
at renderView (core.mjs:9432:1)
at renderComponent$1 (core.mjs:10739:1)
at renderChildComponents (core.mjs:9297:1)
at renderView (core.mjs:9457:1)
at renderComponent$1 (core.mjs:10739:1)
at renderChildComponents (core.mjs:9297:1)
at renderView (core.mjs:9457:1)
For reproduction purposes I have created a very simple Angular app und library.
The app simple uses the library to display some green text.
Library:
https://github.com/obas9000/my-lib
App:
https://github.com/obas9000/my-app
Using node v14.15.0 (npm v6.14.8) everything works fine.
Since using v16.15.0 (npm v8.5.5) the above described error appears.
Steps:
- Clone the lib
cd pathToLib/my-libnvm use 16.15npm inpm run buildnpm run link- Clone the app
cd pathToApp/my-appnvm use 16.15npm inpm link @libs/my-libng serve- go to localhost:4200
I you use nvm use 14.15 everything would work without any error.
Does anybody has an idea how to solve this error?