2

After upgrading from angular 8 to 9 and changed to primeng 9.1.2 (tried also 9.1.3 stay the same), it was working fine, but after the upgrade i keep receiving this error:

ERROR in ./src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve '../../node_modules/primeng/dynamicdialog/primeng dynamicdialog.ngfactory' in 'Path...'

I coudn't find "app.module.ngfactory.js" in the app folder. This is how the module is imported from modules.ts:

import { DynamicDialogModule } from 'primeng/dynamicdialog';
@NgModule({
    imports: [...
    DynamicDialogModule,
    ...]

I tried to change the import path but couldn't succeed to solve the error, other solution for previous primeng did not work for me. I also tried to add this export but it did nothing:

export * from 'primeng/dynamicdialog'; 

I have these imports for the DynamicDialog in the components:

import { DynamicDialogRef } from 'primeng/dynamicDialog';
import { DialogService } from 'primeng/dynamicDialog';
import { DynamicDialogConfig } from 'primeng/dynamicDialog';

I don't know if this can help, but these are my dependencies is my Package.json:

"dependencies": {
    "@angular/animations": "^9.1.13",
    "@angular/cdk": "^9.1.13",
    "@angular/common": "^9.1.13",
    "@angular/compiler": "^9.1.13",
    "@angular/core": "^9.1.13",
    "@angular/forms": "^9.1.13",
    "@angular/platform-browser": "^9.1.13",
    "@angular/platform-browser-dynamic": "^9.1.13",
    "@angular/router": "^9.1.13",
    "@aspnet/signalr": "^1.1.4",
    "@ng-bootstrap/ng-bootstrap": "^6.0.2",
    "@ngx-translate/core": "^11.0.1",
    "@ngx-translate/http-loader": "^4.0.0",
    "@types/jquery": "^3.5.5",
    "@types/universal-analytics": "^0.4.4",
    "angular-auth-oidc-client": "^10.0.15",
    "angular-google-analytics": "^1.1.8",
    "angular2-csv": "^0.2.9",
    "angular2-image-upload": "^1.0.0-rc.2",
    "angularx-qrcode": "^1.6.4",
    "bootstrap": "^4.6.0",
    "chart.js": "^2.9.4",
    "core-js": "^2.6.12",
    "font-awesome": "^4.7.0",
    "hammerjs": "^2.0.8",
    "jquery": "^3.6.0",
    "moment": "^2.29.1",
    "ng2-bootstrap": "^1.6.3",
    "ng2-completer": "^3.0.3",
    "ng2-smart-table": "^1.7.2",
    "ng2-table": "^1.3.2",
    "ngx-bootstrap": "^3.3.0",
    "ngx-gallery": "^5.10.0",
    "node-gyp": "^8.1.0",
    "powerbi-client": "^2.18.0",
    "powerbi-models": "^1.9.0",
    "primeicons": "^2.0.0",
    "primeng": "9.1.2",
    "rxjs": "^6.6.7",
    "tslib": "^1.10.0",
    "xlsx": "^0.14.5",
    "zone.js": "~0.10.2"
  },
Heltarios
  • 29
  • 5
  • 1
    Did you follow the Angular upgrade guide? https://update.angular.io/?v=8.0-9.0 – Mick Jul 14 '21 at 11:52
  • Yes i did follow the guide. – Heltarios Jul 14 '21 at 12:06
  • 1
    If you followed the Angular upgrade guide my guess would be that there are breaking changes between primeng 8.x to 9.x https://github.com/primefaces/primeng/blob/master/CHANGELOG.md#900-rc1-2019-11-26 You could also try deleting your node_modules folder and then run "npm i" afterwards. – Mick Jul 14 '21 at 12:13
  • 1
    Even after deleting the node_modules folder and runing "npm i",i still receave the same error. – Heltarios Jul 14 '21 at 12:38
  • I have no problem in upgading primeng, i have a soutable version for angular 9 (see above), plus there are no mention for a change in the dynamicdialog or anithing related to ngfactory (the changes and bug fixes doese not help). – Heltarios Jul 15 '21 at 12:42
  • 1
    Hi @Heltarios, I recommend you you create a small example with all those libraries and a minimum implementation. I did just that. I got another error, but after an Angular update (to version 12) everything worked fine. Do you need Angular 9? – Janos Vinceller Jul 24 '21 at 13:55
  • 1
    Thank you Janos, i don't really need angular 9, i m upgrading gradually toward angular 12 like mentioned here https://update.angular.io/?l=3&v=8.2-12.0 , but i need to test every upgrade i do so that is why i m trying to solve this error. – Heltarios Jul 26 '21 at 06:34

0 Answers0