benbaran / adal-angular4-example

Angular 4 ADAL Wrapper Example
28 stars 13 forks source link

Error in prod build #14

Closed jszyduk closed 6 years ago

jszyduk commented 6 years ago

Hi, I have project that uses adal-angular4. I get following error on ng build -prod command.

ERROR in Error during template compile of '?a' Function calls are not supported in decorators but '?makeDecorator' was called in 'Injectable' 'Injectable' calls '?makeDecorator'.

Build with no -prod flag works (almost) good but I get following warning (twice):

WARNING in ./node_modules/adal-angular4/node_modules/@angular/core/@angular/core.es5.js 5659:15-36 Critical dependency: the request of a dependency is an expression at ImportLazyContextDependency.getWarnings (PATH\node_modules\webpack\lib\dependencies\ContextDependency.js:39:18) at Compilation.reportDependencyErrorsAndWarnings (PATH\node_modules\webpack\lib\Compilation.js:703:24) at Compilation.finish (PATH\node_modules\webpack\lib\Compilation.js:561:9) at applyPluginsParallel.err (PATH\node_modules\webpack\lib\Compiler.js:502:17) at PATH\node_modules\tapable\lib\Tapable.js:289:11 at _addModuleChain (PATH\node_modules\webpack\lib\Compilation.js:507:11) at processModuleDependencies.err (PATH\node_modules\webpack\lib\Compilation.js:477:14) at _combinedTickCallback (internal/process/next_tick.js:67:7) at process._tickCallback (internal/process/next_tick.js:98:9) @ ./node_modules/adal-angular4/node_modules/@angular/core/@angular/core.es5.js @ ./node_modules/adal-angular4/adal4-interceptor.js @ ./node_modules/adal-angular4/index.js @ ./src/app/app.module.ts @ ./src/main.ts @ multi ./src/main.ts

ng -v looks like this:

Angular CLI: 1.6.0 Node: 6.9.5 OS: win32 x64 Angular: 5.2.0 ... animations, common, compiler, compiler-cli, core, forms ... http, language-service, platform-browser ... platform-browser-dynamic, router

@angular/cli: 1.6.0 @angular-devkit/build-optimizer: 0.0.37 @angular-devkit/core: 0.0.24 @angular-devkit/schematics: 0.0.45 @ngtools/json-schema: 1.1.0 @ngtools/webpack: 1.9.0 @schematics/angular: 0.1.12 typescript: 2.4.2 webpack: 3.10.0

jszyduk commented 6 years ago

First of all, sorry - I put issue in wrong branch it should be here: https://github.com/benbaran/adal-angular4

2nd of all, this issue https://github.com/benbaran/adal-angular4/issues/26 solved my problem.

@Codefearingguy wrote:

"Made 2 important changes to the package node_modules folder and things are working now.

Remove the local "node_modules" folder present inside the "node_modules/adal-angular4". Inside "node_modules/adal-angular4" folder adal4.service.js replace: var rxjs_1 = require("rxjs"); with var rxjs_1 = require("rxjs/Observable");
" In my case, Remove the local "node_modules" folder present inside the "node_modules/adal-angular4". was enough. But I had little bit different error that @Codefearingguy specific solved.

This one can be closed.