Search code examples
angularangular-material

replicate prod angular build error on local


I am getting errors like

error NG8002: Can't bind to 'svgIcon' since it isn't a known property of 'mat-icon'.

I don't get this on my development machine. I tried to replicate it by running "npm run build –prod" but it builds fine without any errors.

What do I have to do to replicate build configuration or mode on my local computer? I am using angular 13.


Solution

  • for anyone who may run into this issue.

    You can try ng build --aot or change the tsconfig.json "angularCompilerOptions": { "strictInjectionParameters": true, "strictInputAccessModifiers": true, "strictTemplates": true }

    to replicate the build for prod