0
votes

I created an AD integration for my angular app. When i try to build it with 'ng build' I get the following error:

ERROR in Metadata version mismatch for module ../node_modules/@azure/msal-angular/dist/index.d.ts, found version 4, expected 3, resolving symbol AppModule in ../src/app/app.module.ts, resolving symbol AppModule in ../src/app/app.module.ts, resolving symbol AppModule in ../src/app/app.module.ts

I tried changing my angular version. But I can't upgrade to angular 5 because I use other packages that don't work with angular 5.

"@angular/common": "4.4.3",
"@angular/compiler": "4.2.4",
"@angular/compiler-cli": "4.4.3",
"@angular/core": "4.4.3",
"@angular/forms": "4.4.3",
"@angular/http": "4.4.3",
"@angular/animations": "4.4.3",
"@angular/cdk": "2.0.0-beta.8",
"@angular/flex-layout": "2.0.0-rc.1",
"@angular/material": "2.0.0-beta.8",
"@angular/platform-browser": "^4.4.7",
"@angular/platform-browser-dynamic": "^4.4.7",
"@angular/platform-server": "^4.4.7",
"@angular/router": "4.4.3",
"@azure/msal-angular": "^0.1.2",

Does anybody know how I can fix my problem?

1

1 Answers

0
votes

I am running into the same issue. I have a workaround but I am not entirely sure why it works. If you go to where your routes are configured and you remove the MsalGuard from your route and rebuild, the error will go away. You can then add the MsalGuard back in the solution will be error free.

This fix seems temporary because every once in a while I will see the error again and just have to repeat the above process. I hope this helps.