1

I am currently working on angular7, and using

 "ngx-extended-pdf-viewer": "^3.3.2",
 "pdfjs-dist": "^2.5.207",
 "@types/pdfjs-dist": "^2.1.6",
 "ng2-pdf-viewer": "^5.3.4",

During opening it on ios 12 it gives error

"ERROR Error: Uncaught (in promise): UnknownErrorException: The browser/environment lacks native support for critical functionality used by the PDF.js library (e.g. ReadableStream and/or Promise.allSettled); please use an ES5-compatible build instead.(…)"

The Fabio
  • 5,369
  • 1
  • 25
  • 55

1 Answers1

0

Good news first: if you're using a contemporary version of ngx-extended-pdf-viewer, you won't see this error message.

The binaries of the PDF viewer ship in two different version: the default build targets modern browsers (i.e. the last two versions of Chrome and Firefox, plus the ESR build of Firefox, and a current version of Safari). If you're using an older browser, the PDF viewer loads the "legacy" build instead. This version has a larger memory footprint and is slower, but it supports a wider range of browsers (but Internet Explorer is not among them).

The error message meant the PDF viewer tried to run the modern build on a browser that doesn't support it. It took a while to get the browser detection right, but by now, it seems to work stable.

In any case, it's a good idea to update to a current version of ngx-extended-pdf-viewer because it's the only version that get updates and bugfixes.

Stephan Rauh
  • 3,069
  • 2
  • 18
  • 37