dimsemenov / PhotoSwipe

JavaScript image gallery for mobile and desktop, modular, framework independent
http://photoswipe.com
MIT License
24.12k stars 3.31k forks source link

[ionic] Type 'undefined' does not satisfy the constraint 'Node'. #2003

Open indraraj26 opened 1 year ago

indraraj26 commented 1 year ago

Getting below error when you do ionic serve

Repo: https://github.com/indraraj26/ionic-photoswipe-test

[ng] Error: node_modules/photoswipe/dist/types/util/util.d.ts:12:123 - error TS2344: Type 'undefined' does not satisfy the constraint 'Node'.
[ng] 
[ng] 12 export function createElement<T extends Falsy | keyof HTMLElementTagNameMap = "div", NodeToAppendElementTo extends Node = undefined>(className?: string | undefined, tagName?: T, appendToEl?: NodeToAppendElementTo): T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : HTMLDivElement;
[ng]                                                           

ionic info

ionic info

Ionic:

   Ionic CLI                     : 6.20.3 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 6.4.0
   @angular-devkit/build-angular : 15.0.3
   @angular-devkit/schematics    : 15.0.3
   @angular/cli                  : 15.0.3
   @ionic/angular-toolkit        : 6.1.0

Capacitor:

   Capacitor CLI      : 4.6.1
   @capacitor/android : not installed
   @capacitor/core    : 4.6.1
   @capacitor/ios     : not installed

Utility:

   cordova-res : not installed globally
   native-run  : 1.7.1

System:

   NodeJS : v18.12.1 (/usr/local/bin/node)
   npm    : 8.19.2
   OS     : macOS Monterey
dweber019 commented 1 year ago

See https://github.com/dimsemenov/PhotoSwipe/issues/1926