Install PDF with importmap

Which product are you using?
PDF.js Express Viewer

PDF.js Express Version
8.7.0

Detailed description of issue
I try to use pdfjs express with importmap because I don’t have any JS compiler on my application.

Viewer is loaded from jspm.io:

<script type="importmap" data-turbo-track="reload">{
  "imports": {
    "@pdftron/pdfjs-express-viewer": "https://ga.jspm.io/npm:@pdftron/pdfjs-express-viewer@8.7.0/webviewer.min.js"
  }
</script>

But on my JS file, the line import WebViewer from "@pdftron/pdfjs-express-viewer" return me an error on console:

Uncaught (in promise) TypeError: WebViewer is not a function

Expected behaviour
The expected behaviour is that the import works without any JS error.

Does your issue happen with every document, or just one?
Issue happen on installation, before loading any PDF doc

Code snippet
{Provide a relevant code snippet}

Hi there,

Thank you for contacting pdf.js express forums,

I am not familiar with importmap instantiation but can you try the following guides:

If these do not apply to you, can you share any screenshots or a minimal runnable sample project to troubleshoot?

Thank you in advance.

Best regards,
Kevin Kim


Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here