A license key is required to use the view only build of PDF.js Express

Which product are you using?
PDF.js Express Viewer. From the package.json file:

  "name": "@pdftron/pdfjs-express-viewer",
  "description": "PDFJS Express",
  "version": "8.7.5",
  "main": "lib/webviewer.min.js",

PDF.js Express Version

|UI version|'8.7.0'|
|---|---|
|Core version|'8.7.5'|
|webviewer.min.js|'8.7.5'|
|Build|'Ny80LzIwMjR8MzMxOTBmNGM5YQ=='|
|WebViewer Server|false|
|Full API|false|

Detailed description of issue
Strictly using the example code in the manual integration section (PDF.js Express Viewer Download & Integration | Documentation), the js console constantly complains about the license key:

PDFJSDocumentType.js:118 A license key is required to use the view only build of PDF.js Express. Get your free license key at https://pdfjs.express/profile (account required)

PDFJSDocumentType.js:119 Uncaught (in promise) 
Error: A license key is required to use the view only build of PDF.js Express. Get your free license key at https://pdfjs.express/profile (account required)
    at error (PDFJSDocumentType.js:119:1)
    at PDFJSDocumentType.js:2697:417

The viewer itself loads. After a second, however, it goes gray with a circle in the middle. This is on a server that’s in a subdomain of the one the license key has been issued for.

Expected behaviour
Expected behavior is that the PDF loads in the window and no license key errors in the console.

Does your issue happen with every document, or just one?
All documents, even the sample ones provided in the documentation’s sample code.

Link to document

Code snippet

<div id='viewer' style="width:1024px;height:600px;margin:0 auto"></div>
<script>
  WebViewer({
    path:       '/js/pdfjsexpress/lib',
    licenseKey: '--removed--',
    initialDoc: 'https://pdftron.s3.amazonaws.com/downloads/pl/webviewer-demo.pdf',
    // initialDoc: '/path/to/my/file.pdf',  // You can also use documents on your server
  }, document.getElementById('viewer'))
  .then(instance => {
    // now you can access APIs through the WebViewer instance
    const { Core, UI } = instance;
    // adding an event listener for when a document is loaded
    Core.documentViewer.addEventListener('documentLoaded', () => {
      console.log('document loaded');
    });
    // adding an event listener for when the page number has changed
    Core.documentViewer.addEventListener('pageNumberUpdated', (pageNumber) => {
      console.log(`Page number is: ${pageNumber}`);
    });
  });
</script>    

An update with no solution in sight: I’ve replaced the PDF.js Express viewer code with that downloaded from here: https://pdfjs.express/download-viewer and flushed all the caches wherever they might be. I’ve also created a new license key for the subdomain in question. I’ve also also moved the code around to different servers that I know are accessible from the internet. None of this has helped.

Hello afuller,

It looks like the testing environment included is causing this, if you only remove the code from the sample so it looks like this:

viewing sample:

WebViewer(
  {
    path: '../../../lib',
    enableFilePicker: true,
    licenseKey: "key",
    initialDoc: 'https://pdftron.s3.amazonaws.com/downloads/pl/demo-annotated.pdf',
  },
  document.getElementById('viewer')
).then(instance => {

});

There is no error and the product works as expected.

Best regards,
Tyler