themyth92 / ngx-lightbox

Lightbox2 use with angular >= 5
MIT License
115 stars 67 forks source link

Updating to 2.5.1 broke HttpInterceptor on my app #109

Closed aleperfetti81 closed 2 years ago

aleperfetti81 commented 2 years ago

Hi all,

tomorrow morning i've upgraded ngx-lightbox from 2.4.1 to 2.5.1 and my HttpInterceptor got broken. The intercept method defined in it was not called for LazyLoaded modules. It seems there was another package intercepting http requests.

After doing some testing, I found that it was the ngx-lightbox update that caused this problem. Bringing it back to the previous version solved the problem.

Has anyone else had this problem? If so, how can I fix it?

Thanks!

Following is my dev environment:

Angular CLI: 12.2.8 Node: 12.14.0 Package Manager: npm 6.13.4 OS: win32 x64

Angular: 12.2.8 ... animations, cdk, cli, common, compiler, compiler-cli, core ... forms, language-service, material, material-moment-adapter ... platform-browser, platform-browser-dynamic, router**

Package Version

@angular-devkit/architect 0.1202.8 @angular-devkit/build-angular 12.2.8 @angular-devkit/core 12.2.8 @angular-devkit/schematics 12.2.8 @schematics/angular 12.2.8 rxjs 7.3.1 typescript 4.3.4

themyth92 commented 2 years ago

Hmm probably related to the new package i added to the dependancy list called ngx-filesaver. Not sure how to fix these though, so troublesome with this.

aleperfetti81 commented 2 years ago

Hmm probably related to the new package i added to the dependancy list called ngx-filesaver. Not sure how to fix these though, so troublesome with this.

Hi themyth92,

from what i read, the problem is the import of HttpClientModule in your main module. You should avoid this. HttpClientModule should be imported once, from the app importing your ngx-lightbox.

I think it has nothing to do with ngx-filesaver.

themyth92 commented 2 years ago

Hmm i think u are right. I am not really sure why that module is there. Will remove it

aleperfetti81 commented 2 years ago

Very good. Could you let me know when a new fixed version will be online? So i could give it a try and let you know.

Thanks

Roman-Simik commented 2 years ago

I spent almost 3 hours debugging this problem in app and then I found it by rollbacking in git history because I would never imagine that image-gallery library can break whole http , you don' do any testing or what?

themyth92 commented 2 years ago

Hey @Roman-Simik , i am not your employee lol. This is open source, feel free to use something else !

themyth92 commented 2 years ago

@aleperfetti81 Can u try to run again with 2.5.2. Just remove the http module from this lib. Tks. Sorry for the long time, very busy nowadays.

aleperfetti81 commented 2 years ago

@aleperfetti81 Can u try to run again with 2.5.2. Just remove the http module from this lib. Tks. Sorry for the long time, very busy nowadays.

@themyth92 i tried with 2.5.2 and it fixes the problem, thanks ;)

themyth92 commented 2 years ago

Tks a lot @aleperfetti81