0

Just started angular and I am trying to use a PDF Viewer integrated into my application. I saw ngx-extended-pdf-viewer while browsing which library to use and tried to installed it. After installing and running the app using ng-serve, it shows an error like this:

node_modules/ngx-extended-pdf-viewer/lib/document-properties/pdf-document-properties-overlay/pdf-document-properties-overlay.component.d.ts:7:21

  • error TS2694: Namespace '"D:/Programming/Angular/basics-assignment-1-start/node_modules/@angular/core/core"' has no exported member 'ɵɵComponentDeclaration'.

7 static ɵcmp: i0.ɵɵComponentDeclaration<PdfDocumentPropertiesOverlayComponent, "pdf-document-properties-overlay", never, {}, {}, never, never>;

{
  "name": "my-first-app",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~11.0.0",
    "@angular/common": "~11.0.0",
    "@angular/compiler": "~11.0.0",
    "@angular/core": "~11.0.0",
    "@angular/forms": "~11.0.0",
    "@angular/platform-browser": "~11.0.0",
    "@angular/platform-browser-dynamic": "~11.0.0",
    "@angular/router": "~11.0.0",
    "bootstrap": "3.4.1",
    "ngx-extended-pdf-viewer": "^11.2.0-alpha.1",
    "rxjs": "~6.6.0",
    "rxjs-compat": "^6.0.0",
    "tslib": "^2.0.0",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.1100.0",
    "@angular/cli": "~11.0.0",
    "@angular/compiler-cli": "~11.0.0",
    "@types/jasmine": "~3.6.0",
    "@types/node": "^12.11.1",
    "codelyzer": "^6.0.0",
    "jasmine-core": "~3.6.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~5.1.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.0.3",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "^1.5.0",
    "protractor": "~7.0.0",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "~4.0.2"
  }
}

What should I do to resolve this issue? Thank you.

Jose Lora
  • 1,392
  • 4
  • 12
  • 18
  • Can you share your code in stackblitz? It is quite hard to identify what is your exact problem. However, I think something is wrong in you Module or in component. I am using ngx-extended-pdf-viewer in my project without any problem. I have just followed the instructions. – Srijon Chakraborty Jan 23 '22 at 03:49
  • sorry, I am not sure how to upload my code in stackblitz but I've added my package.json in the post. I just added the ngx-extended-pdf-viewer in my previous sample apps and added the import in the app.module.ts and when I tried to run, shows the error. – Germie Fernandez Jan 24 '22 at 04:51

2 Answers2

1

There could be come issues with node modules folder. Check the folder for the package and please check package.json file.

ouflak
  • 2,458
  • 10
  • 44
  • 49
  • I've added my package.json in the post, not sure what the problem is since I've only added it to my previous app to test ngx-extended-pdf-viewer. – Germie Fernandez Jan 24 '22 at 04:52
0

If nuking and reinstalling node_modules isn't working, what ended up working for me was downgrading the package to ^10.0.0.