Solvedng2 pdf viewer Module '"../../../../@types/pdfjs-dist"' has no exported member 'PDFPromise'

Bug Report or Feature Request
- [ ] Regression
- [x] Bug report
- [ ] Feature request
- [ ] Documentation issue or request

Hello there i got the next error with "ng2-pdf-viewer": "^6.4.0" version. Thx

Error: node_modules/ng2-pdf-viewer/src/app/pdf-viewer/pdf-viewer.module.d.ts:7:100 - error TS2305: Module '"../../../../@types/pdfjs-dist"' has no exported member 'PDFPromise'.

export { PDFJSStatic, PDFDocumentProxy, PDFViewerParams, PDFPageProxy, PDFSource, PDFProgressData, PDFPromise } from 'pdfjs-dist';

13 Answers

✔️Accepted Answer

Fixed in version 6.4.1

Other Answers:

Try use these versions:

"ng2-pdf-viewer": "6.3.2",
"@types/pdfjs-dist": "2.1.7",
"pdfjs-dist": "2.5.207"

I found the solution 🎉

Just add this in your package.json, after ng2-pdf-viewer:

"@types/pdfjs-dist": "2.1.7"

Issue seems to have be triggered by @types/pdfjs-dist moving from version 2.1.7 to 2.7.0 about 4 hours ago.

Can confirm that @srizzon's suggested versions fix the problem for me:

"ng2-pdf-viewer": "6.3.2",
"@types/pdfjs-dist": "2.1.7",
"pdfjs-dist": "2.5.207"

More Issues: