ionic-team / ionic-team/ionic-framework

bug: Failed to fetch dynamically imported module after updating to new Angular build system

オープン
#30,092 コメント 5 件 リアクション 2 件 担当者 0 名 GitHub で見る
triage
主要言語
TypeScript
スター
52.7k
フォーク
13.3k
平均マージ
1日 15時間
マージ済み PR(30日)
51

説明

### Prerequisites

- [X] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#creating-an-issue).
- [X] I agree to follow the [Code of Conduct](https://ionicframework.com/code-of-conduct).
- [X] I have searched for [existing issues](https://github.com/ionic-team/ionic-framework/issues) that already report this problem, without success.

### Ionic Framework Version

v8.x

### Current Behavior

After updating to the latest version of Ionic 8.4.1 and migrating to Angular 17, if you switch to Angular's new "application" build system, the build runs successfully. However, when running the command ionic serve, the application starts but displays a blank screen. Upon inspecting the console, the following errors can be observed:

```
Failed to load resource: the server responded with a status of 504 (Outdated Optimize Dep)
:8100/@fs/D:/_git/MyProject/Bitbucket/MyApp/.angular/cache/17.3.11/vite/deps/ion-split-pane.entry.js?import:1


Failed to load resource: the server responded with a status of 504 (Outdated Optimize Dep)
:8100/@fs/D:/_git/MyProject/Bitbucket/MyApp/.angular/cache/17.3.11/vite/deps/ion-menu_3.entry.js?import:1


Failed to load resource: the server responded with a status of 504 (Outdated Optimize Dep)
index-28849c61.js:4 TypeError: Failed to fetch dynamically imported module: http://localhost:8100/@fs/D:/_git/MyProject/Bitbucket/MyApp/.angular/cache/17.3.11/vite/deps/ion-app_8.entry.js?import undefined
consoleError @ index-28849c61.js:4
zone.js:1046 Error: Constructor for "ion-content#undefined" was not found
at index-28849c61.js:5:25555
at step (tslib.es6.mjs:147:21)
at Object.next (tslib.es6.mjs:128:51)
at fulfilled (tslib.es6.mjs:118:56)
at _ZoneDelegate.invoke (zone.js:368:26)
at Zone2.run (zone.js:129:43)
at zone.js:1257:36
at _ZoneDelegate.invokeTask (zone.js:402:31)
at Zone2.runTask (zone.js:173:47)
at drainMicroTaskQueue (zone.js:581:35)
api.onUnhandledError @ zone.js:1046
index-28849c61.js:4 TypeError: Failed to fetch dynamically imported module: http://localhost:8100/@fs/D:/_git/MyProject/Bitbucket/MyApp/.angular/cache/17.3.11/vite/deps/ion-app_8.entry.js?import undefined
consoleError @ index-28849c61.js:4
zone.js:1046 Error: Constructor for "ion-router-outlet#undefined" was not found
at index-28849c61.js:5:25555
at step (tslib.es6.mjs:147:21)
at Object.next (tslib.es6.mjs:128:51)
at fulfilled (tslib.es6.mjs:118:56)
at _ZoneDelegate.invoke (zone.js:368:26)
at Zone2.run (zone.js:129:43)
at zone.js:1257:36
at _ZoneDelegate.invokeTask (zone.js:402:31)
at Zone2.runTask (zone.js:173:47)
at drainMicroTaskQueue (zone.js:581:35)
api.onUnhandledError @ zone.js:1046
index-28849c61.js:4 TypeError: Failed to fetch dynamically imported module: http://localhost:8100/@fs/D:/_git/MyProject/Bitbucket/MyApp/.angular/cache/17.3.11/vite/deps/ion-app_8.entry.js?import undefined
consoleError @ index-28849c61.js:4
zone.js:1046 Error: Constructor for "ion-header#undefined" was not found
at index-28849c61.js:5:25555
at step (tslib.es6.mjs:147:21)
at Object.next (tslib.es6.mjs:128:51)
at fulfilled (tslib.es6.mjs:118:56)
at _ZoneDelegate.invoke (zone.js:368:26)
at Zone2.run (zone.js:129:43)
at zone.js:1257:36
at _ZoneDelegate.invokeTask (zone.js:402:31)
at Zone2.runTask (zone.js:173:47)
at drainMicroTaskQueue (zone.js:581:35)
```

### Expected Behavior

Serve the app with the new build system.

### Steps to Reproduce

Update an older app to Ionic 8;
Update Angular to at least Angular 17;
Migrate to the new build system "@angular-devkit/build-angular:application".

### Code Reproduction URL

no link

### Ionic Info

Ionic:

Ionic CLI : 7.2.0 (C:\Users\hsantos\AppData\Roaming\nvm\v22.12.0\node_modules\@ionic\cli)
Ionic Framework : @ionic/angular 8.4.1
@angular-devkit/build-angular : 17.3.11
@angular-devkit/schematics : 17.3.11
@angular/cli : 17.3.11
@ionic/angular-toolkit : 12.1.1

Capacitor:

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

Utility:

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

System:

NodeJS : v22.12.0 (C:\Program Files\nodejs\node.exe)
npm : 10.9.0
OS : Windows 10

### Additional Information

_No response_

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。