polifonia-project / sonar2021_demo

This repository is created for the documentation of the Polifonia demo that is going to be presented to SONAR2021
https://polifonia-project.github.io/sonar2021_demo/
2 stars 0 forks source link

ng build throws many "... is not a known element" errors #69

Closed phivk closed 2 years ago

phivk commented 2 years ago

On the latest develop, when I run

$ ng build

it throws many errors like the one below:

Error: src/app/app.component.html:1:1 - error NG8001: 'app-topbar' is not a known element:
1. If 'app-topbar' is an Angular component, then verify that it is part of this module.
2. If 'app-topbar' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

1 <app-topbar></app-topbar>
  ~~~~~~~~~~~~

  src/app/app.component.ts:8:16
    8   templateUrl: './app.component.html',
                     ~~~~~~~~~~~~~~~~~~~~~~
    Error occurs in the template of component AppComponent.

On that latest commit, the CI build test also failed: https://github.com/polifonia-project/sonar2021_demo/runs/3937737344

@JaseMK this seems to have something to do with the way components are (not) registered or imported? Am I perhaps missing a config locally?

phivk commented 2 years ago

same behaviour for

$ ng serve
ccolonna commented 2 years ago

It seems you are seeing the same error appearing in CI . As creating an ng component will also provide a test for the component for free. We can run test locally and resolve issues.

JaseMK commented 2 years ago

I'm genuinely a bit confused by this. All our components are declared in app.module.ts as they should be. It also seems odd that the GH checks were working fine up to a point and then started failing constantly from then on. I can't see an easy way of suppressing checks and the test errors don't make enough sense to me to be able to fix them. I'll continue looking and also install and try to build the Angular app on my other laptop in case that throws up any clues.

phivk commented 2 years ago

@JaseMK I was able to trace the issue to this commit: ba7ec5e444f99fed8af88d292f3fb15dab9c289c From that moment on, the errors appear. Earlier commits work fine.

phivk commented 2 years ago

@JaseMK I removed my node_modules dir and did a fresh npm install and the errors are gone! really sorry to cause confusion!