'Error on building app using Ngx-extended-pdf-viewer
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.
Solution 1:[1]
There could be come issues with node modules folder. Check the folder for the package and please check package.json file.
Solution 2:[2]
If nuking and reinstalling node_modules
isn't working, what ended up working for me was downgrading the package to ^10.0.0
.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | ouflak |
Solution 2 | James Meisler |