Ionic 8 Angular 18: "The above dynamic import cannot be analyzed by Vite."

  • The fix was to delete .angular and node_modules, then reinstall dependencies with npm install. Simple and effective!
  1. Make every component import from '@ionic/angular' to
    '@ionic/angular/standalone'
  2. Remove IonicModule and from my entire project even in
    app.config.ts

There should be not import { IonicModule } from '@ionic/angular'; in entire project.

Further more:- You could simply search @ionic/angular for these keyword and make sure it is replace by @ionic/angular/standalone.

Following all these the error gone.

1 Like