Cannot open pdf.js more than once per site

Which product are you using?

PDF.js Express Version

Detailed description of issue
I am making a website of schematics stored as pdf files. Each pdf will be on it’s own page accessible by a UPC label. First page works but when I create another page the document doesn’t load. Error message displayed in console is "A valid license key is required to use the view only build of PDF.js "

Expected behaviour
{To load the pdf file passed into the viewer}

Does your issue happen with every document, or just one?
{With every document but the first one}

Link to document
{Provide a link to the document in question if possible}

Code snippet
{
WebViewer({
path: ‘/test/PDFJSExpress-view-only/lib’, // path to the PDF.js Express’lib’ folder on your server
licenseKey: ‘xxxxxxxxxxxxxx’,
initialDoc: “/test/Model.pdf”}, document.getElementById(‘viewer’))
.then(instance => {
// now you can access APIs through the WebViewer instance
const { Core, UI } = instance;
}

Thank you for posting the incident to our forum. We will provide you with an update as soon as possible.

Hi there,

We generally recommend our users to use loadDocument to load another document within the same instance of the viewer:

If you need to use multiple instances, make sure they all have the license in the WebViewer constructor and the url is on the same domain as the registered license key.

If you are still experiencing issues, could you please share a minimal runnable reproducible sample project?

Best regards,
Kevin Kim