Using pdfjs causes app to freeze on splashscreen

When I import pdfjs on v5.5 core component, it works well on the browser. But after building the app with cordova for iOS & android, iOS freezes on splashscreen startup and android shows a timeout error on webview.

Pdfjs usage,

  import pdfjsLib from "pdfjs-dist/webpack";
  import * as pdfjsWorker from "pdfjs-dist/build/pdf.worker.min";

  export default {
    methods: {
      displayFileOnCanvas(source) {
        const canvas = document.createElement("canvas");

        // Set worker path to worker bundle
        pdfjsLib.GlobalWorkerOptions.workerSrc = pdfjsWorker;
        // More logic that works on browser

But if I comment out all of this functionality, the app launches perfectly.

Also when webpack compiles with pdfjs, there is an extra entry point (…worker.js).