Error: Constructor for “ion-app#undefined” was not found after upgrade to Angular 18.1 and Ionic 8

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 .angularcache18.1.1vitedeps 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:UserspeterAppDataRoamingnpmnode_modules@ioniccli)
   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 Filesnodejsnode.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 just noticed the following in the terminal window…

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`.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật