Base solution for your next web application
Open Closed

Angular navigation blocked on module lazy load #10546


User avatar
0
Ricavir created

Prerequisites

  • ABP 6.4
  • Angular 12
  • .NET 5
  • Metronic 5

The app is running on Azure App Service. 2 deployments slots are available :

  • Staging slot : the app is published in this slot firstly. Some validation tests are done before going to production
  • Production slot : used for production. When staging slot is validated, we swap slots from staging to production.

After every deployment, we are having troubles when angular modules are lazy loaded. When a user navigates to a page that needs to lazy load an angular module, the navigation is blocked ; the spinner remains running blocking any user action. In that situation, it is not possible to open browser tooling (F12) for the current page. The user has to press F5 to refresh the page and get the app running again. It seems like a browser caching issue or something like that but I don't figure out how to fix it.

Did you already faced that issue with abp products ?


6 Answer(s)
  • User Avatar
    0
    musa.demir created

    Hi @ricavir

    Is there any error on your log file?

  • User Avatar
    0
    Ricavir created

    Hi @musa.demir

    No, nothing on server log file. Seems to be a client side issue only

  • User Avatar
    0
    musa.demir created

    Hi @ricavir Can you please open browser console then reproduce the error and check console logs and network?

  • User Avatar
    0
    Ricavir created

    I can't predict exactly when it happens. I can try for the next deployments to leave the browser console open and check what happens. Don't you had this kind of issues with other users ?

  • User Avatar
    0
    Ricavir created

    I manage to get the console log. The issue is :

    main-es2015.5af5014b1fa0edb28992.js:1 ERROR Error: Uncaught (in promise): ChunkLoadError: Loading chunk 56918 failed.
    

    I found some information about that in the web : https://medium.com/@kamrankhatti/angular-lazy-routes-loading-chunk-failed-42b16c22a377

    This is caused by chunk names update on new app build and deployment. This is due to browser cache. I will try the solution provided in the article (global error handler) and give a feedback if it works.

    This can help other users

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @ricavir

    Thank you for your feedback and sharing the solution.