pdf fails to display: TypeError: Cannot read properties of undefined (reading 'GlobalWorkerOptions')
I used the following component code
<script>
let pdfInfos;
export let file;
import { onMount } from "svelte";
let PdfViewer;
onMount(async () => {
const module = await import("svelte-pdf-viewer");
PdfViewer = module.default;
});
</script>
<svelte:component this={PdfViewer} file={ file } bind:infos={ pdfInfos } />
but chromium console shows the following error.
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'GlobalWorkerOptions')
at instance3 (PdfRender.svelte:19:14)
at init (index.mjs:1997:11)
at new PdfRender (PdfRender.svelte:38:38)
at create_fragment4 (PdfViewer.svelte:4:26)
at init (index.mjs:2012:37)
at new PdfViewer (PdfViewer.svelte:46:9)
at construct_svelte_component_dev (index.mjs:2213:26)
at Object.update [as p] (PdfViewer.svelte:15:34)
at update (index.mjs:1193:36)
at flush (index.mjs:1160:13)