Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
hatsantos opened this issue Dec 19, 2024 · 0 comments
Open
3 tasks done
Labels

Comments

@hatsantos
Copy link

Prerequisites

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

@ionitron-bot ionitron-bot bot added the triage label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant