Hi, I have just upgraded my Ionic v7 / Angular 16 app to Ionic v8, Angular v18, and now I get runtime errors where it looks like it can’t load any of the Ionic
components.
If I look into my .angular\cache\18.1.1\vite\deps folder, I do not see anything starting with Ion…
I did go through all the Angular and Ionic upgrade instructions, and it compiles fine, but I get these runtime errors.
I am not sure if this is relevant, but there are also updates to the Angular build…
Ionic info:
$ ionic info
Ionic:
Ionic CLI : 7.2.0 (C:\Users\peter\AppData\Roaming\npm\node_modules\@ionic\cli)
Ionic Framework : @ionic/angular 8.2.5
@angular-devkit/build-angular : 18.1.1
@angular-devkit/schematics : 18.1.1
@angular/cli : 18.1.1
@ionic/angular-toolkit : 11.0.1
Cordova:
Cordova CLI : 11.0.0
Cordova Platforms : android 13.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 13 other plugins)
Utility:
cordova-res : 0.15.4
native-run : not installed globally
System:
NodeJS : v20.15.1 (C:\Program Files\nodejs\node.exe)
npm : 10.7.0
OS : Windows 10
Would any one have any ideas what is missing here (or how I can further diagnose)?
Thanks in advance
[UPDATE1]
I also notice the following in my terminal
ng] Application bundle generation complete. [4.600 seconds]
[ng] Watch mode enabled. Watching for file changes...
[ng] NOTE: Raw file sizes do not reflect development server per-request transformations.
[ng] Re-optimizing dependencies because lockfile has changed
[ng] ➜ Local: http://127.0.0.1:8100/
[ng] ➜ press h + enter to show help
[ng] 8:02:56 am [vite] warning:
[ng] C:/dev/my-app/.angular/cache/18.1.1/vite/deps/chunk-GQGXXH53.js
[ng] 900| return i[n];
[ng] 901| }
[ng] 902| return import("./".concat(a, ".entry.js").concat("")).then(function(e2) {
[ng] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ng] 903| {
[ng] 904| cmpModules.set(a, e2);
[ng] See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations for supported dynamic import formats. If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.
[ng]
[ng] Plugin: vite:import-analysis
[ng] File: C:/dev/my-app/.angular/cache/18.1.1/vite/deps/chunk-GQGXXH53.js?v=e850c948
[ng] The file does not exist at "C:/dev/my-app/.angular/cache/18.1.1/vite/deps/ion-app_8.entry.js" which is in the optimize deps directory. The dependency might be incompatible with the dep optimizer. Try adding it to `optimizeDeps.exclude`.
[ng] The file does not exist at "C:/dev/my-app/.angular/cache/18.1.1/vite/deps/ion-menu_3.entry.js" which is in the optimize deps directory. The dependency might be incompatible with the dep optimizer. Try adding it to `optimizeDeps.exclude`.
[ng] The file does not exist at "C:/dev/my-app/.angular/cache/18.1.1/vite/deps/ion-item_8.entry.js" which is in the optimize deps directory. The dependency might be incompatible with the dep optimizer. Try adding it to `optimizeDeps.exclude`.
[ng] The file does not exist at "C:/dev/my-app/.angular/cache/18.1.1/vite/deps/ion-loading.entry.js" which is in the optimize deps directory. The dependency might be incompatible with the dep optimizer. Try adding it to `optimizeDeps.exclude`.
[ng] The file does not exist at "C:/dev/my-app/.angular/cache/18.1.1/vite/deps/ion-app_8.entry.js" which is in the optimize deps directory. The dependency might be incompatible with the dep optimizer. Try adding it to `optimizeDeps.exclude`.
[ng] The file does not exist at "C:/dev/my-app/.angular/cache/18.1.1/vite/deps/ion-menu_3.entry.js" which is in the optimize deps directory. The dependency might be incompatible with the dep optimizer. Try adding it to `optimizeDeps.exclude`.
[ng] The file does not exist at "C:/dev/my-app/.angular/cache/18.1.1/vite/deps/ion-item_8.entry.js" which is in the optimize deps directory. The dependency might be incompatible with the dep optimizer. Try adding it to `optimizeDeps.exclude`.
[ng] The file does not exist at "C:/dev/my-app/.angular/cache/18.1.1/vite/deps/ion-loading.entry.js" which is in the optimize deps directory. The dependency might be incompatible with the dep optimizer. Try adding it to `optimizeDeps.exclude`.