1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Angular failing to load route in Ionic Cordova Android production build only

Discussão em 'Angular' iniciado por peterc, Setembro 16, 2025.

  1. peterc

    peterc Guest

    I have been updating my Ionic Angular application to latest version and standalone. All is working fine when I run using "ng serve", and also my iOS runs fine in the iOS simulator.

    However, when I run the Android build (on both a phone AND the emulator), I have two routes that fail.

    I am logging out the router events, and I see the following for one of the failed routes...

    00000292 32.07667160 [11508] [DEBUG] MyApp - 6c0972eb102e11cd - AppRoutingService: Router event NavigationStart(id: 20, url: '/performance')
    00000293 32.07699203 [11508] [DEBUG] MyApp - 6c0972eb102e11cd - AppRoutingService: Router event RouteConfigLoadStart(path: performance)
    00000294 32.07778549 [11508] [DEBUG] MyApp - 6c0972eb102e11cd - AppRoutingService: Router event NavigationError(id: 20, url: '/performance', error: TypeError: Failed to fetch dynamically imported module: https://localhost/chunk-5YE56RPK.js)


    If I build the Android version in debug, so I can attach to it on the device via Chrome, I do NOT get this error.

    I have unzipped the build .apk, and the file chunk-5YE56RPK.js is there

    If I put chunk-5YE56RPK.js into a test html page, and do a fetch on it, it loads OK.

    I have no idea why this, and one other route are failing - all others work, and also why just on Android when built in production.

    AppRoutingService is my service where I just end up calling the Ionic navigateForward.

    [​IMG]

    This has never failed before.

    Anyone have any ideas how I can diagnose this further?

    Continue reading...

Compartilhe esta Página