ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
51.13k stars 13.5k forks source link

bug: ionic-pwa produces dynamic import cannot be analyzed by Vite warning #29978

Closed muuvmuuv closed 3 weeks ago

muuvmuuv commented 3 weeks ago

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

I know that there already was #28576 but this is definitaly produced by the pwa-loader after pwa-camera and other modules are loaded. Vite just prints a warning so I would like to suggested adding /* @vite-ignore */ somewhere to just ignore that part for people building with Vite. Same goes for ionicons I guess it is also happening there.

Expected Behavior

No warning.

Steps to Reproduce

Start Angular Ionic application and add:

import { defineCustomElements } from '@ionic/pwa-elements/loader'
defineCustomElements(window)

Code Reproduction URL

Open for discussions first

Ionic Info

Ionic:

   Ionic CLI                     : 7.2.0 (/Users/marvin/.bun/install/global/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 8.3.1
   @angular-devkit/build-angular : 19.0.0-next.13
   @angular-devkit/schematics    : 19.0.0-next.13
   @angular/cli                  : 19.0.0-next.13
   @ionic/angular-toolkit        : not installed

Capacitor:

   Capacitor CLI      : 6.1.2
   @capacitor/android : 6.1.2
   @capacitor/core    : 6.1.2
   @capacitor/ios     : 6.1.2

Utility:

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

System:

   NodeJS : v22.10.0 (/Users/marvin/.proto/tools/node/22.10.0/bin/node)
   npm    : 10.9.0
   OS     : macOS Unknown

Additional Information

No response

muuvmuuv commented 3 weeks ago

Oh wait sry didnt know pwa-elements has its own repo: https://github.com/ionic-team/pwa-elements/issues/129