I (possibly) found the reason. I had a component and an index ts file like this:
libs/components/src/lib/my-component
my-component.component.ts
my-component.component.html
my-component.component.scss
index.ts
The index.ts file had only one line it, an export:
export { MyComponent } from './my-component.component';
In my tsconfig.json
there is a path defined like this:
"@components/*": [
"libs/components/src/lib/*/index.ts"
],
The component was then imported like this:
import { MyComponent } from '@components/my-component';
Removing the index.ts file and just importing the component directly by its actual path solved it.
However, I cannot really say why or if it was just a coincidence.