Open Closed

Exception in browser at initial pageload of a deployed production build #5945


User avatar
1
devpayoff created
  • ABP Framework version: v7.3.3
  • UI Type: Angular
  • Database System: EF Core (PostgreSQL)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
main.32733563c8aaffad.js:1 Uncaught TypeError: Cannot set properties of undefined (setting 'ɵfac')
    at 4160 (main.32733563c8aaffad.js:1:1216871)
    at l (runtime.e3f26f76c119af31.js:1:127)
    at 63849 (main.32733563c8aaffad.js:1:80537)
    at l (runtime.e3f26f76c119af31.js:1:127)
    at main.32733563c8aaffad.js:1:1332542
    at n (runtime.e3f26f76c119af31.js:1:32226)
    at main.32733563c8aaffad.js:1:53

  • Steps to reproduce the issue: generate the commercial template with abp new prova -t app-pro -u angular -v 7.3.3 build in production mode with npm run "build:prod" serve it locally with cd dist/prova && npx --yes angular-http-server

We encounter the SAME issue with our deployed app (based on ABP 7.3.2, when deleting yarn.lock and republishing it) and with commercial template v 7.4. (since our deployed app builds and runs correctly with an older yarn.lock file and the same codebase, it seems an issue related to upgraded versions of some package...., but it's absurd that this happens also with a clean template!) Really need help... thank you


5 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello devpayoff,

    I am able to reproduce the issue at my end and working on it.

    can you please share yarn.lock file by which you are able to run project successfully so that I can better assist you.

    Regards,

  • User Avatar
    -1
    Anjali_Musmade created
    Support Team Support Team Member

    Hello devpayoff,

    Can you please try this I was able to repro and able to run the project with the below solution.

    "configurations": {
        "production": {
          "optimization": false,  // added
          "budgets": [
            {
              "type": "initial",
              "maximumWarning": "5mb", // updated
              "maximumError": "8mb" // updated
            },
            {
              "type": "anyComponentStyle",
              "maximumWarning": "2kb",
              "maximumError": "100kb"
            }
          ],
          "fileReplacements": [
            {
              "replace": "src/environments/environment.ts",
              "with": "src/environments/environment.prod.ts"
            }
          ],
          "outputHashing": "all"
        },
    
  • User Avatar
    1
    devpayoff created

    Yes, disabling optimization it works, but it's not something we can accept. We could manage to solve the issue UPGRADING all Angular packages to ver. ~16.2.8 and "@angular-devkit/build-angular": "~16.2.5".

  • User Avatar
    0
    devpayoff created

    I can't find a way to upload my yarn.lock....

  • User Avatar
    -1
    masum.ulu created
    Support Team Angular Expert

    Hello devpayoff,

    Can you please send your package.json file's content. We are using version ~16.0.0 for @angular/* and @angular-* packages. That's why can you please normalize your angular packages. Also @abp/* & @volo/* package's version must be the same for example: ~7.3.0 it will install latest patch version because of ~ sign.

    You can check version matrix with @abp and @angular packages at the templates folder.

    If you sent me your package.json file I'll try to re-produce your case

Made with ❤️ on ABP v9.1.0-preview. Updated on December 05, 2024, 12:19