I have been stuck on this for a day now.
On a clean repo, after doing an pnpm install, then an ng serve, you end up with this error in the console
...does not have 'ɵmod' property
This can happen with any module and the workaround below work for any module. NOTE: This can also happen if you have imported something other than a Module - there is nothing wrong with my imports in this case.
Workarounds:
While those workarounds may be adequate for a development environment, in a CI environment, you have to essentially have ng build twice to workaround the issue (which comes at a cost).
My solution in my CI build at the moment is to build twice (Scary to tell a compiler, if you don't get it right the first time, have another go...)
How do you go about finding the root cause of this issue? (So I can have a single ng build step in my CI build).
The issue for me is that I was using pnpm as package manager. Unfortunately, pnpm doesn't seem to play nicely with ngcc - pnpm uses hard-links in the node_modules folder. I have raised an issue with pnpm.
It turns out that pnpm can also cause the following issues (all fixable by running ng serve or build again):
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With