LilRazi
LilRazi

Reputation: 770

app is broken after updating to angular 9 and primeng

We have updated our angular application written on 8 to angular 9 and also the primeng library to 9.0.0-rc.4 but we are getting following error messages which is related to primeng.

import { MessageService } from 'primeng/components/common/api';
    src/app/component/attachm.component.ts:5:55 - error TS2307: Cannot find module 'primeng/components/common/api'.
import { DynamicDialogRef, DynamicDialogConfig } from 'primeng/components/common/api';
    src/app/component/email.component.ts:5:34 - error TS2307: Cannot find module 'primeng/components/common/api'.

Package.json looks like this

"dependencies": {
    "@angular/animations": "^9.0.1",
    "@angular/common": "~9.0.1",
    "@angular/compiler": "~9.0.1",
    "@angular/core": "~9.0.1",
    "@angular/forms": "~9.0.1",
    "@angular/localize": "^9.0.1",
    "@angular/platform-browser": "~9.0.1",
    "@angular/platform-browser-dynamic": "~9.0.1",
    "@angular/router": "~9.0.1",
    "primeflex": "^1.0.0",
    "primeicons": "^2.0.0",
    "primeng": "^9.0.0-rc.4",
    "rxjs": "~6.5.4",
    "tslib": "^1.10.0",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.900.2",
    "@angular/cli": "~9.0.2",
    "@angular/compiler-cli": "~9.0.1",
    "@angular/language-service": "~9.0.1",
    "@types/node": "^12.11.1",
    "@types/jasmine": "~3.3.8",
    "@types/jasminewd2": "~2.0.3",
    "codelyzer": "^5.1.2",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.15.0",
    "typescript": "~3.6.4"
  }

is the specific things we need to do to fix this problem?

Upvotes: 5

Views: 8861

Answers (1)

shire
shire

Reputation: 49

change primeng/components/common/api to primeng/api.

DynamicDialogRef is probably changed to DynamicDialogModule from primeng/dynamicdialog

Now you may see the pattern. I use Visual Studio code and it helps me find the modules and their respective primeng src by suggesting as i type.

Upvotes: 3

Related Questions