Module x has no exported member 'PDFDocumentProxy' +n
See original GitHub issueBug Report or Feature Request (mark with an x
)
Hello guys.
There’s some trouble with this package.
I use following angular specs: Fresh installation of Angular and only added ng2-pdf-viewer
"@angular/animations": "~11.1.0",
"@angular/common": "~11.1.0",
"@angular/compiler": "~11.1.0",
"@angular/core": "~11.1.0",
"@angular/forms": "~11.1.0",
"@angular/platform-browser": "~11.1.0",
"@angular/platform-browser-dynamic": "~11.1.0",
"@angular/router": "~11.1.0",
"ng2-pdf-viewer": "^6.3.2",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.11.3"
I registered the PdfViewerModule in app.module.ts. Nothing else done. No deps, no tricky relations. Clean angular + import of PdfViewerModule
Running ng serve
AND GET THIS
Error: node_modules/ng2-pdf-viewer/src/app/pdf-viewer/pdf-viewer.component.d.ts:5:10 - error TS2305: Module '"../../../../pdfjs-dist/types/pdf"' has no exported member 'PDFDocumentProxy'.
5 import { PDFDocumentProxy, PDFSource, PDFProgressData } from 'pdfjs-dist';
~~~~~~~~~~~~~~~~
Error: node_modules/ng2-pdf-viewer/src/app/pdf-viewer/pdf-viewer.component.d.ts:5:28 - error TS2305: Module '"../../../../pdfjs-dist/types/pdf"' has no exported member 'PDFSource'.
5 import { PDFDocumentProxy, PDFSource, PDFProgressData } from 'pdfjs-dist';
~~~~~~~~~
Error: node_modules/ng2-pdf-viewer/src/app/pdf-viewer/pdf-viewer.component.d.ts:5:39 - error TS2305: Module '"../../../../pdfjs-dist/types/pdf"' has no exported member 'PDFProgressData'.
5 import { PDFDocumentProxy, PDFSource, PDFProgressData } from 'pdfjs-dist';
~~~~~~~~~~~~~~~
Error: node_modules/ng2-pdf-viewer/src/app/pdf-viewer/pdf-viewer.module.d.ts:1:10 - error TS2305: Module '"../../../../pdfjs-dist/types/pdf"' has no exported member 'PDFJSStatic'.
1 import { PDFJSStatic } from 'pdfjs-dist';
~~~~~~~~~~~
Error: node_modules/ng2-pdf-viewer/src/app/pdf-viewer/pdf-viewer.module.d.ts:7:10 - error TS2305: Module '"../../../../pdfjs-dist/types/pdf"' has no exported member 'PDFJSStatic'.
7 export { PDFJSStatic, PDFDocumentProxy, PDFViewerParams, PDFPageProxy, PDFSource, PDFProgressData, PDFPromise } from 'pdfjs-dist';
~~~~~~~~~~~
Error: node_modules/ng2-pdf-viewer/src/app/pdf-viewer/pdf-viewer.module.d.ts:7:100 - error TS2305: Module '"../../../../pdfjs-dist/types/pdf"' has no exported member 'PDFPromise'.
7 export { PDFJSStatic, PDFDocumentProxy, PDFViewerParams, PDFPageProxy, PDFSource, PDFProgressData, PDFPromise } from 'pdfjs-dist';
~~~~~~~~~~
Error: node_modules/ng2-pdf-viewer/src/app/pdf-viewer/pdf-viewer.module.d.ts:7:23 - error TS2305: Module '"../../../../pdfjs-dist/types/pdf"' has no exported member 'PDFDocumentProxy'.
7 export { PDFJSStatic, PDFDocumentProxy, PDFViewerParams, PDFPageProxy, PDFSource, PDFProgressData, PDFPromise } from 'pdfjs-dist';
~~~~~~~~~~~~~~~~
Error: node_modules/ng2-pdf-viewer/src/app/pdf-viewer/pdf-viewer.module.d.ts:7:41 - error TS2305: Module '"../../../../pdfjs-dist/types/pdf"' has no exported member 'PDFViewerParams'.
7 export { PDFJSStatic, PDFDocumentProxy, PDFViewerParams, PDFPageProxy, PDFSource, PDFProgressData, PDFPromise } from 'pdfjs-dist';
~~~~~~~~~~~~~~~
Error: node_modules/ng2-pdf-viewer/src/app/pdf-viewer/pdf-viewer.module.d.ts:7:58 - error TS2305: Module '"../../../../pdfjs-dist/types/pdf"' has no exported member 'PDFPageProxy'.
7 export { PDFJSStatic, PDFDocumentProxy, PDFViewerParams, PDFPageProxy, PDFSource, PDFProgressData, PDFPromise } from 'pdfjs-dist';
~~~~~~~~~~~~
Error: node_modules/ng2-pdf-viewer/src/app/pdf-viewer/pdf-viewer.module.d.ts:7:72 - error TS2305: Module '"../../../../pdfjs-dist/types/pdf"' has no exported member 'PDFSource'.
7 export { PDFJSStatic, PDFDocumentProxy, PDFViewerParams, PDFPageProxy, PDFSource, PDFProgressData, PDFPromise } from 'pdfjs-dist';
~~~~~~~~~
Error: node_modules/ng2-pdf-viewer/src/app/pdf-viewer/pdf-viewer.module.d.ts:7:83 - error TS2305: Module '"../../../../pdfjs-dist/types/pdf"' has no exported member 'PDFProgressData'.
7 export { PDFJSStatic, PDFDocumentProxy, PDFViewerParams, PDFPageProxy, PDFSource, PDFProgressData, PDFPromise } from 'pdfjs-dist';
To reproduce this just:
- Install fresh angular project
- Add ng2-pdf-viewer
- Import that module in app.module.ts or wherever you need it
- Get the error
In node_modules there is @types/pdfjs-dist BUT ng2-pdf-viewer doesn’t use it.
I tried to reinstall, to install @types/pdfjs-dist @types/node and rolled back to lower node version. Nothing helps. I am very hard relied on that package for coming rollout these days.
Can anyone good guy help to fix this?
Shake your hands, dudes.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:23
- Comments:29 (4 by maintainers)
Top Results From Across the Web
Typescript: Module X has no exported member Y
I got it to work and I believe I found the problem. Above the import I had another import that must caused the...
Read more >Module x has no exported member 'PDFDocumentProxy' +n
Coming soon: A brand new website interface for an even better experience!
Read more >module '"react-router-dom"' has no exported member ...
esm.js Attempted import error: 'useRouteMatch' is not exported from 'react-router-dom'.
Read more >Module has no exported member error in TypeScript
The error "Module has no exported member" occurs when we try to import a member that doesn't exist in the specified module. To...
Read more >mozilla-central: changeset 398058 ... - Mercurial
PDFDocumentProxy = PDFDocumentProxy; exports. ... If a copy of the MPL was not distributed with this * file, You can obtain one at ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fixed in version 6.4.0
Hey people. I’m not using this library, just pdfjs-dist directly, but I fixed the types (as shown here https://github.com/mozilla/pdf.js/issues/12384#issuecomment-695138631) by importing them as following: