grumar / adal-angular5

Angular 5 ADAL Wrapper
MIT License
12 stars 19 forks source link

Post Angular 6 and rxjs Upgrade throws runtime error. #41

Open ravivit9 opened 6 years ago

ravivit9 commented 6 years ago

After upgrading to Angular 6 and rxjs library I started seeing the following.

ERROR in node_modules/@angular/core/src/render3/ng_dev_mode.d.ts(9,11): error TS2451: Cannot redeclare block-scoped variable 'ngDevMode'. node_modules/adal-angular5/node_modules/@angular/core/src/render3/ng_dev_mode.d.ts(9,11): error TS2451: Cannot redeclare block-scoped variable 'ngDevMode'. src/app/services/api.service.ts(33,5): error TS2719: Type 'Observable' is not assignable to type 'Observable'. Two different types with this name exist, but they are unrelated. Property 'operator' is protected in type 'Observable' but public in type 'Observable'. src/app/services/api.service.ts(39,5): error TS2719: Type 'Observable' is not assignable to type 'Observable'. Two different types with this name exist, but they are unrelated.

screen shot 2018-05-09 at 11 38 57
kmng1 commented 6 years ago

The error is due to two different versions of @angular. adal-angular5/node_modules has its own copy of @angular/core, but at v5. Need to rebuild with updated dependencies, as have been done for benbaran/adal-angular4.

aemonge commented 6 years ago

I'm trying to do it for you, but I don't see which is the command you've set up for the build. Neigher npm build nor ng buld works.

aemonge commented 6 years ago

I've seen you used gulp => gulp package. But I'm still getting other errors:

ERROR in node_modules/@angular/core/src/render3/ng_dev_mode.d.ts(9,11): error TS2451: Cannot redeclare block-scoped variable 'ngDevMode'.
node_modules/adal-angular5/node_modules/@angular/core/src/render3/ng_dev_mode.d.ts(9,11): error TS2451: Cannot redeclare block-scoped variable 'ngDevMode'.

I'm not 100% sure if the error is due to the library or my "hello-world" app.

ravivit9 commented 6 years ago

@grumar, any plans in near future an upgrade of Adal5 to angular 6 version?

aemonge commented 6 years ago

@ravivit9 I'm currently working on a fork that naivelly tries to upgrade, please feel free to help !

https://github.com/aemonge/adal-angular5

aemonge commented 6 years ago

So... my navie and initial attempt is done: https://www.npmjs.com/package/adal-angular6

Now it's time to test this out fully and keep fixing future bugs, I hope this helps both @ravivit9 and @kmng1 and of course the comunity !!

ravivit9 commented 6 years ago

Thanks @aemonge, will try the above and update this ticket with feedback.

byjoshi008 commented 6 years ago

I have tried adal-angular6 but the problem is "acquireToken" doesn't work. There is a fix for "acquireToken" in adal-angular5 version 2.1.1. Is there any plan to provide similar fix for adal-angular6?