question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Angular 9 for Internet Explorer 11 dont work vendor.js compile error

See original GitHub issue
Bug Report or Feature Request (mark with an x)
- [ ] Regression (a behavior that used to work and stopped working in a new release)
- [x ] Bug report -> please search issues before submitting
- [ ] Feature request
- [ ] Documentation issue or request

I use “ng2-pdf-viewer”: “^6.3.0” and upgraded my project to “@angular/core”: “^9.1.9”, In Chrome i have no Problems but when I try to compile the project in es5 and start IE11 locally I get a error from the vendor.js

SCRIPT1010: Indentifier expected
vendor.js (158998,9)
{
  const { <--- Breaks here
    isNodeJS
  } = __w_pdfjs_require__(7);

  if (isNodeJS) {
    const PDFNodeStream = __w_pdfjs_require__(19).PDFNodeStream;

    pdfjsDisplayAPI.setPDFNetworkStreamFactory(params => {
      return new PDFNodeStream(params);
    });
  } else {
    const PDFNetworkStream = __w_pdfjs_require__(22).PDFNetworkStream;

    let PDFFetchStream;

    if (pdfjsDisplayDisplayUtils.isFetchSupported()) {
      PDFFetchStream = __w_pdfjs_require__(23).PDFFetchStream;
    }

    pdfjsDisplayAPI.setPDFNetworkStreamFactory(params => {
      if (PDFFetchStream && pdfjsDisplayDisplayUtils.isValidFetchUrl(params.url)) {
        return new PDFFetchStream(params);
      }

      return new PDFNetworkStream(params);
    });
  }
}

Has anybody an idea what the problem is?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:12

github_iconTop GitHub Comments

4reactions
chintan3100commented, Jul 8, 2020

Add below package image

image

Set worker js in App component (<any>window).pdfWorkerSrc = ‘./scripts/pdf.worker.js’; Do not use above code to load worker. It will create performance issue to navigate pdf pages. User below (window as any).pdfWorkerSrc = import(‘pdfjs-dist/webpack’);

2reactions
m0pycommented, Jun 9, 2020

Add below package image

image

Set worker js in App component (window).pdfWorkerSrc = ‘./scripts/pdf.worker.js’;

It works for me without any problems! Thanks!!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vendor.js throwing syntax error for ng-idle library for IE 11
js file while running angular 9 application in IE 11. I've enabled all the polyfills and changed the target to "es5" in tsconfig.json...
Read more >
Browser support - Angular
Angular is built on the latest standards of the web platform. Targeting such a wide range of browsers is challenging because they do...
Read more >
Angular < 13: How to support IE11 - DEV Community ‍ ‍
In this article I will show you the steps I took to support Internet Explorer 11 with Angular. The first half of this...
Read more >
How To Fix Your Angular App When It's Not Working in IE11
Sometimes, your application may throw errors in IE11, even when it is working fine in other browsers. There can be numerous reasons why...
Read more >
IE doesn't work after Angular 9 update : r/Angular2 - Reddit
js '; // Run npm install --save classlist.js. /** Evergreen browsers require these. **/ import 'core-js/es/reflect'; import 'core-js/proposals/ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found