Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while loading PDF document #25

Open
malte-v opened this issue Nov 17, 2019 · 2 comments
Open

Error while loading PDF document #25

malte-v opened this issue Nov 17, 2019 · 2 comments

Comments

@malte-v
Copy link

malte-v commented Nov 17, 2019

When I call PDFJS.getDocumentByString, I get the following error:

errors.dart:145 Uncaught (in promise) Error: Type '_Future<dynamic>' should be '_Future<PDFDocumentProxy>' to implement expected type 'Future<PDFDocumentProxy>'.
    at Object.throw_ [as throw] (errors.dart:194)
    at Object.castError (errors.dart:43)
    at Object.cast [as as] (operations.dart:424)
    at Function.check_C [as _check] (classes.dart:512)
    at Object._promiseToFuture (private.dart:33)
    at pdfjs.PDFDocumentLoadingTask._withJsInternal.[_initFuture] (pdf_document_loading_task.dart:31)
    at new pdfjs.PDFDocumentLoadingTask._withJsInternal (pdf_document_loading_task.dart:27)
    at Function.getDocument (pdfjs_global.dart:144)
    at Function.getDocumentByString (pdfjs_global.dart:155)
    at Object.main$ [as main] (main.dart:7)
    at main$ (main_web_entrypoint.dart:9)
    at main$.next (<anonymous>)
    at onValue (async_patch.dart:45)
    at _RootZone.runUnary (zone.dart:1379)
    at _FutureListener.thenAwait.handleValue (future_impl.dart:137)
    at handleValueCallback (future_impl.dart:678)
    at Function._propagateToListeners (future_impl.dart:707)
    at async._AsyncCallbackEntry.new.callback (future_impl.dart:387)
    at Object._microtaskLoop (schedule_microtask.dart:41)
    at _startMicrotaskLoop (schedule_microtask.dart:50)
    at async_patch.dart:166

I'm using pdf.js version 2.1.266. Any idea how to fix this issue? Thanks in advance!

@malte-v
Copy link
Author

malte-v commented Nov 17, 2019

A minimal working example would really be great!

@seanburke-wf
Copy link
Contributor

This looks like a typing error on our part. A PR is in progress to address this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants