If you are having this issue in Angular 8 or Angular 9 (like I was), after:
and you're still having issues, and you are Lazy Loading Modules check your angularCompilerOptions
in your tsconfig.json
or tsconfig.app.json
, and make sure that "strictMetadataEmit" is set to false or is removed.
"angularCompilerOptions": {
"preserveWhitespaces": false,
"strictInjectionParameters": true,
"fullTemplateTypeCheck": true,
"strictTemplates": true,
// "strictMetadataEmit": true <-- remove this setting or set to false
},
The setting is to help library creators which should never have lazy loaded modules built in. I had previously (using Angular 7) set all "strict" options to true...