ranveeraggarwal/angular-adal-quickstart

Webpack + Angular 2/4 : prod build failure

Closed this issue · 2 comments

Hi,

I am trying to integrate this package with a brand new Angular 2 app (using "@angular/core": "^4.1.2" in package.json). I'm using webpack to do the build instead of SystemJs.

Local dev build with ng build and ng serve is working fine but prod build with ng build --prod --aot fails with the following error.

ERROR in Error encountered resolving symbol values statically. Calling function 'makeDecorator', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol Injectable in c:/path-to-my-project/node_modules/ng2-adal/node_modules/@angular/core/src/di/metadata.d.ts, resolving symbol Injectable in c:/path-to-my-project/node_modules/ng2-adal/node_modules/@angular/core/src/di.d.ts, resolving symbol Injectable in c:/path-to-my-project/node_modules/ng2-adal/node_modules/@angular/core/src/core.d.ts, resolving symbol Injectable in c:/path-to-my-project/node_modules/ng2-adal/node_modules/@angular/core/index.d.ts, resolving symbol BrowserXhr in
c:/path-to-my-project/node_modules/ng2-adal/node_modules/@angular/http/src/backends/browser_xhr.d.ts, resolving symbol BrowserXhr in c:/path-to-my-project/node_modules/ng2-adal/node_modules/@angular/http/src/backends/browser_xhr.d.ts

Is this because the package is built using older Angular version? Is there a way I can get around it or fix it?

I couldn't make this work with webpack when I was working on this, but I have heard that installing adal.d.ts and changing some configurations fixes the issue. Do let me know if you find a fix.

I wasn't able to figure out what the exact problem was. But I decided to use MSAL JS and a custom authentication service of my own. AFAIK, MSAL is a possible replacement for ADAL going forward.