Tagged: angular library ivy angular12
October 20, 2021 at 2:27 pm #676723
I upgraded my Angular project to version 12. It uses Ivy to build my entire project. The project contains 1 library which contains components, services and model classes. All components are declared and exported in the library module.ts file. They are also in the public_api.ts file. I have several projects that use that library and its components. At runtime there are no errors. All components, services etc. are found.
However in MyEclipse, when I open a project component that uses that uses a library component I get the error:
‘bar-common-fy22-proposal-requirements-panel’ is not a known element:
1. If ‘bar-common-fy22-proposal-requirements-panel’ is an Angular component, then verify that it is part of this module.
2. If ‘bar-common-fy22-proposal-requirements-panel’ is a Web Component then add ‘CUSTOM_ELEMENTS_SCHEMA’ to the ‘@NgModule.schemas’ of this component to suppress this message.
This was all working fine using the Codemix plugin and Angular 10 using the old View Engine compiler.
Is there a solution to this problem in MyEclipse?October 22, 2021 at 5:36 am #676743
Sorry that you are seeing this issue.
Can you please recheck if any of the installed libraries version are incompatible with Angular 12?
Try deleting the node_modules folder and then run
npm installagain to check if it helps fix the issue.
Genuitec SupportOctober 26, 2021 at 11:54 am #676805
I upgraded my project to Angular 12 and I am successfully running it. There are no errors.
However when I open the project files using MyEclipse I get the aforementioned error when I open a component HTML file which references a component from the bar-common library. Angular 12 uses the Ivy compiler which does not generate the lib-name.metadata.json file. I even changed my bar-common library to use “strictTemplates”: true at compile time. That seemed todo the trick in Visual Code Studio and IntelliJ. Both of those IDEs have no problem finding my ‘bar-common-fy22-proposal-requirements-panel’ component.
MichaelOctober 26, 2021 at 12:00 pm #676806
My Angular project is setup as a multi project workspace:
bar-common (library shared across my applications)
I start out with a clean workspace inside of angular-test. I removed node_modules, dist and package-lock.json. Then I do:
ng build –project=bar-common
All applications are running just fine. The error only happens when I open an HTML file referencing a bar-common component in MyEclipse.