-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
Comments
I had the same issue after upgrading to the new build system. For me I fixed it by disabling the cache in the "cli" section of the
Now |
@Xenon0412 thank you for your comment. What are the consequences of disabling the CLI cache? Won't the performance gains from the new build system be lost if the cache is disabled? Okay, not all of the performance gains will be lost, but it certainly won't be an ideal situation... Between updates, I usually also remove the /.cache folder to ensure there are no conflicts, and this time, I'm sure I did that as well... But I didn't try disabling the cache entirely. I'll create a branch again and run some experiments... However, if that's the case, I think it should be documented in Ionic and there should be more information about the migration process... we're a bit in the dark... If I cant upgrade my app to V17/V18, my app will be "lost" in a legacy code base... |
@hatsantos For sure, the solution is only a workaround for now. I don't know the details about the angular cache, but I think you will only have a performance impact on startup (until ionic serve is ready) and not while developing, because of the hot module replacement (HMR). There are some dynamic imports which are not compatible with the new build system (Vite). Vite or some sub-library doesn't understand the dynamic import statement and therefore it does not copy the referenced files to the cache folder. At runtime, when you open the local website, the files should be imported, but they are missing and you will see the error you mentioned. For now, I can continue my work with a disabled cache, because for me it is more important to have the new build system and using the newest angular version. Therefore you should also be able to update your app to angular 18 (hopefully). I hope that the ionic team will fix this issue in one of the next releases. |
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:
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
The text was updated successfully, but these errors were encountered: