IE11 not able to load PDFJS worker
See original GitHub issueBefore you start - checklist
- I followed instructions in documentation written for my React-PDF version
- I have checked if this bug is not already reported
- I have checked if an issue is not listed in Known issues
- If I have a problem with PDF rendering, I checked if my PDF renders properly in Mozilla Firefox
Description
IE11 does not render PDFs with 5.0.0-beta.3 or latest version 4.1
Steps to reproduce
Steps to reproduce the behavior:
- Use IE11
- Load any PDF using a URL (or local file)
- See the following error
Also noting that with this library I have to add a worker SRC otherwise the PDF will not load.
import { Document, Page, pdfjs } from 'react-pdf'
...
pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.js`
Expected behavior
IE11 should load PDF js documents. Also noting that @mikecousins/react-pdf
will load. So perhaps there is a method or configuration to support IE11 that is missing.
Additional information
Environment
- Browser (if applicable) [e.g. Chrome 57, Firefox 59]: IE11 (chrome & firefox have no issue)
- React-PDF version [e.g. 3.0.4]: 4.1 and also tested on 5.0.0-beta.3
- React version [e.g. 16.3.0]: 16.13.0
- Webpack version (if applicable) [e.g. 4.16.2]: 4.42.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
PDF.js not working on IE 11 - Stack Overflow
IE11 doesn't support ES6 format, so some features of PDF. js won't work in IE11. You could try to use the ES5 version...
Read more >WebViewer not getting loaded in IE 11 - PDF.js Express
Hello Logan, WebViewer is not getting loaded in the IE-11, I have changed my code and make it ECMA-5 supportive due to IE-11...
Read more >PDFObject: A JavaScript utility for embedding PDFs
PDFObject. An open-source standards-friendly JavaScript utility for embedding PDF files into HTML documents. Why Use PDFObject? Browser Support; API.
Read more >pdfjs-dist - npm
Generic build of Mozilla's PDF.js library.. Latest version: 3.1.81, last published: a month ago. Start using pdfjs-dist in your project by ...
Read more >ngx-extended-pdf-viewer/README.md - UNPKG
38, Not to mention the ability to display PDF files, running on Mozilla's ... `ng2-pdfjs-viewer` are they also support Internet Explorer 11 (with...
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 FreeTop 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
Top GitHub Comments
Unfortunately, in v5, support for IE 11 has been dropped. There’s nothing we can do about it. Sorry about that!
If you still need to continue support IE 11, you’re stuck at v4.x.
See thread: https://github.com/wojtekmaj/react-pdf/issues/495#issuecomment-662036968
Facing issues with IE11 as well… I do think it needs to be a babel configuration problem… It appears that my webpack configuration is not compiling the
react-pdf
import ofpdfjs-dist
to es5.When I look at the compiled code, it is still using es6 code which is why it’s failing on IE11. It would be great if we could get an IE11 compatible config.