angular-modal-gallery icon indicating copy to clipboard operation
angular-modal-gallery copied to clipboard

Carousel: No provider for Overlay

Open syrok0010 opened this issue 2 years ago • 6 comments

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request

Current behavior

I have the following module structure AppModule ->NavigationModule ->AdminPanelModule->HotelModule My component with carousel is located in HotelModule

<div class="container" *ngIf="photos$ | async as photos; else loading">
    <ks-carousel [id]="600" [images]="photos" [config]="config"></ks-carousel>
    <app-hotel-gallery-form></app-hotel-gallery-form>
</div>
<ng-template #loading>
    <tui-loader
        [showLoader]="true"
        [size]="'xl'"
        [textContent]="'Подождите, идет загрузка...'"
    >
    </tui-loader>
</ng-template>

It produces the following error

ERROR Error: NullInjectorError: No provider for Overlay!
    at NullInjector.get (core.mjs:11140:1) [angular]
    at R3Injector.get (core.mjs:11307:1) [angular]
    at R3Injector.get (core.mjs:11307:1) [angular]
    at R3Injector.get (core.mjs:11307:1) [angular]
    at injectInjectorOnly (core.mjs:4765:1) [angular]
    at Module.ɵɵinject (core.mjs:4769:1) [angular]
    at Object.ModalGalleryService_Factory [as factory] (ks89-angular-modal-gallery.mjs:3816:1) [angular]
    at R3Injector.hydrate (core.mjs:11477:1) [angular]
    at R3Injector.get (core.mjs:11296:1) [angular]
    at NgModuleRef.get (core.mjs:21867:1) [angular]
    at R3Injector.get (core.mjs:11307:1) [angular]
    at NgModuleRef.get (core.mjs:21867:1) [angular]
    at R3Injector.get (core.mjs:11307:1) [angular]
    at NgModuleRef.get (core.mjs:21867:1) [angular]

I found a fix: add MatMenuModule to NavigationModule (don't ask why)

Expected behavior

No need to use MatMenuModule

Minimal reproduction of the problem with instructions

TODO

What is the motivation / use case for changing the behavior?

Less dependencies, smaller bundle size

Environment (the most important section to fill very carefully)


- @ks89/angular-modal-gallery version: 9.0.1
- Node version: 17.9.0
- npm version: none
- yarn version: 1.22.18
- Operating System and version: Arch Linux
- Angular version: 13.3.3
- angular-cli version (or SystemJS/Webpack): 13.3.3
- I'm using Server Side Rendering with angular-universal: NO
- I'm compiling with mode: DEBUG

Browser:
- [x] Chrome (desktop) version Brave 1.37
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX

syrok0010 avatar Apr 16 '22 13:04 syrok0010

Hi. Did you install angular/cdk as written in the readme?

npm install --save hammerjs mousetrap @angular/cdk

Ks89 avatar Apr 16 '22 18:04 Ks89

Hi, sure. v13.3.3

syrok0010 avatar Apr 16 '22 19:04 syrok0010

Do you have a runnable minimal example to prove this issue? I cannot reproduce it.

Ks89 avatar Apr 16 '22 20:04 Ks89

I cant reproduce it too. Maybe the problem is with nested lazy-loaded modules (based on the fix available)

syrok0010 avatar Apr 16 '22 21:04 syrok0010

Without a runnable code to reproduce this I can't do anything. Did you try to remove node_modules and reinstall everything from scratch?

Ks89 avatar Apr 22 '22 22:04 Ks89

I see. I tried to remove node_modules and reinstall

syrok0010 avatar Apr 24 '22 09:04 syrok0010

closed, because inactive

Ks89 avatar Aug 16 '23 13:08 Ks89