Reputation: 49
I got the following
Uncaught Error: Type CommonModule does not have 'ɵmod' property. at getNgModuleDef (core.js:1131:1)
Everything works in my machine with global Angular CLI version (13.3.5) and local version (12.2.17). But when I copy the src to Amazon Workspace and install angular (global 14.2.6 and local 12.2.18), I got a blank page, though no compiling error reported. When I inspect the console, I saw
Uncaught Error: Type CommonModule does not have 'ɵmod' property. at getNgModuleDef (core.js:1131:1)
Check the web and replace "CommonModule" with "BrowseModule" but still get the same error, even though there is no "CommonModule" directly used everywhere in the project. Same thing after I did cache clean and even restarted the machine.
Upvotes: 0
Views: 248
Reputation: 49
Run this command: npm c
After above command, ng serve --o
will recompile and launch the application.
When I had the problem, VS code does not have any compiling error. The error only shows when inspecting with Console in the browser. At that time, only text in the index.html shows. The test text in the app.component.html does not show (not mentioning other children components).
Upvotes: 0