Skip to content

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

@muuvmuuv

Description

@muuvmuuv

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions