Tagged: angular library ivy angular12
- This topic has 3 replies, 2 voices, and was last updated 3 years ago by mhast.
-
AuthorPosts
-
mhastParticipantI 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?
support-swapnaModeratorHi,
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 runnpm install
again to check if it helps fix the issue.–Swapna
Genuitec Support
mhastParticipantHi Swapna:
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.
Michael
mhastParticipantMy Angular project is setup as a multi project workspace:
angular-test
projects
bar-common (library shared across my applications)
App1
App2
…I start out with a clean workspace inside of angular-test. I removed node_modules, dist and package-lock.json. Then I do:
npm install
ng build –project=bar-common
npm installAll applications are running just fine. The error only happens when I open an HTML file referencing a bar-common component in MyEclipse.
-
AuthorPosts