Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

fix: bump PDF.js version to enable IE11 #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

fix: bump PDF.js version to enable IE11 #24

wants to merge 2 commits into from

Conversation

platosha
Copy link

Fixes #23

@@ -34,7 +34,7 @@
"vaadin-lumo-styles": "vaadin/vaadin-lumo-styles#^1.3.3",
"vaadin-material-styles": "vaadin/vaadin-material-styles#^1.2.0",
"vaadin-license-checker": "^2.1.0",
"pdfjs-dist": "2.0.943",
"pdfjs-dist": "2.1.266",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also submit a PR to bundled-es-modules:
https://github.com/bundled-es-modules/pdfjs-dist

An then update it the dependency-map.json in magi.

@platosha
Copy link
Author

I’ve forked pdfjs-dist and made a branch with updated version with hope to make it work in IE11 and P3: https://github.com/platosha/pdfjs-dist/tree/chore/2.1.266

Unfortunately, even after the update, it does not work in IE11 with Polymer 3. I have this error:

SCRIPT28 Out of stack space

Similar symptoms as in here: webcomponents/webcomponentsjs#972

Basically, both the @webcomponents/webcomponentsjs v2 polyfill, and the PDF.js build include different Symbol polyfills, which are incompatible between each other. An error is thrown as soon as the PDF.js main bundle or the worker script is loaded after the webcomponentjs polyfills.

With P2, however, it works, because @webcomponents/webcomponentsjs v1 doesn’t include a Symbol polyfill.

Potential ways to tackle this are, and none of them are easy:

  • Make PDF.js not depend on core-js Symbol polyfill, requires changes in PDF.js
  • Make webcomponentsjs use core-js Symbol, requires changes in webcomponentsjs
  • Include the core-js polyfills before webcomponentsjs, requires multiple changes in, basically, every our repo.

The next thing to try here would be making a custom PDF.js build and bundling it with the component.

@CLAassistant
Copy link

CLAassistant commented Aug 19, 2021

CLA assistant check
All committers have signed the CLA.

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

Successfully merging this pull request may close these issues.

Pdf file is not rendered in IE11
3 participants