daelmaak / ngx-gallery

Homepage
https://daelmaak.github.io/ngx-gallery/
Apache License 2.0
16 stars 4 forks source link

IntersectionObserver is not defined in Angular 18 #107

Closed yalesnikov closed 2 weeks ago

yalesnikov commented 2 weeks ago

I have an error with Ngx Gallery in Angular 18. Will you update "@daelmaak/ngx-gallery": "^3.0.4" ?

ERROR ReferenceError: IntersectionObserver is not defined
    at _ThumbsComponent.observeArrows (eval at instantiateModule (/node_modules/vite/dist/node/chunks/dep-DyBnyoVI.js:52905:24), <anonymous>:684:32)
    at Timeout.eval (eval at instantiateModule (/node_modules/vite/dist/node/chunks/dep-DyBnyoVI.js:52905:24), <anonymous>:585:16)
    at Timeout.timer (eval at instantiateModule (/node_modules/vite/dist/node/chunks/dep-DyBnyoVI.js:52905:24), <anonymous>:1853:27)
    at _ZoneDelegate.invokeTask (eval at instantiateModule (node_modules/vite/dist/node/chunks/dep-DyBnyoVI.js:52905:24), <anonymous>:339:171)
    at eval (eval at instantiateModule (node_modules/vite/dist/node/chunks/dep-DyBnyoVI.js:52905:24), <anonymous>:17015:49)
    at AsyncStackTaggingZoneSpec.onInvokeTask (eval at instantiateModule (/node_modules/vite/dist/node/chunks/dep-DyBnyoVI.js:52905:24), <anonymous>:17015:30)
    at _ZoneDelegate.invokeTask (eval at instantiateModule (/node_modules/vite/dist/node/chunks/dep-DyBnyoVI.js:52905:24), <anonymous>:339:54)
    at Object.onInvokeTask (eval at instantiateModule (/node_modules/vite/dist/node/chunks/dep-DyBnyoVI.js:52905:24), <anonymous>:17205:25)
    at _ZoneDelegate.invokeTask (eval at instantiateModule (/node_modules/vite/dist/node/chunks/dep-DyBnyoVI.js:52905:24), <anonymous>:339:54)
    at ZoneImpl.runTask (eval at instantiateModule (/node_modules/vite/dist/node/chunks/dep-DyBnyoVI.js:52905:24), <anonymous>:147:37)
pappkamerad commented 2 weeks ago

I also just ran into this. it happens when doing SSR with thumbsArrows set to true

yalesnikov commented 2 weeks ago

I think it happens because Angular use hydration and new build systems in lasts versions. This error I see with dev mode.

yalesnikov commented 2 weeks ago

I also just ran into this. it happens when doing SSR with thumbsArrows set to true

I think it happens because Angular use hydration and new build systems in lasts versions. This error I see with dev mode.

daelmaak commented 2 weeks ago

Thanks for the issue guys, fixed in https://github.com/daelmaak/ngx-gallery/releases/tag/v3.1.0.