Skip to content

Error while loading PDF document #25

@malte-v

Description

@malte-v

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions