Error: I have a valid license key but i still have errors

Which product are you using?
PDF.js Express Viewer

PDF.js Express Version 8.7.0

Detailed description of issue
Hello,

I have a valid license key associated with my account, and it matches the one used in my project. However, the viewer has suddenly stopped working, even though I haven’t made any changes to the PDF.js Express implementation.

I am now receiving the following error message:

“A valid license key is required to use the view-only build of PDF.js Express. Get your free license key at PDF.js Express (account required).”

Expected behaviour
At the start it was working.

Does your issue happen with every document, or just one?
{Answer here}

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

Code snippet
{Provide a relevant code snippet}

Hello Alex,

Could you provide the full license key you are using? You can send it to darian.chen@apryse.com. Are there any other console or network errors? Please also provide the code snippet for the constructor showing how you are passing the license key.

Hello Darian,
Thank you for your reply.
I’m attaching a screenshot of the errors that appear when I try to open a PDF.In my .env file, I have the following license key configured:


VITE_APP_PDF_EXPRESS_KEY=bwr9K9ZtZ3T2CCX15cgM

Here is the relevant part of my code where I initialize the viewer:

Hello Alex,

Are there any network errors? I don’t see the part where you initialize the viewer in your last response. Are you seeing watermarks and this error in your production environment?

Hi,
Thanks for your reply.
To clarify the current situation:

  1. There are no network errors in the browser console.
  2. The viewer works correctly only on localhost. PDFs open without issue and the license key is recognized. We see the message:

PDFJS.express: Development environment detected. This license key is currently registered to digital.atelieruldeit.ro

  1. However, in both of our live environments —
    • Staging: [https://digital.atelieruldeit.ro](https://digital.atelieruldeit.ro/)
    • Production: [https://digital.tbf.ro](https://digital.tbf.ro/)
    • — the PDF viewer no longer works at all. PDFs do not load, and the following error appears in the console:

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

There are no watermarks — the viewer fails completely.
We are using two separate license keys, one for each environment, and each key is injected properly during the build process based on the domain. This setup was working fine until recently, and no changes have been made on our side since then.
Could there be an issue with the license validation on your end, or have there been any recent changes to domain/license handling?
We’d appreciate your help resolving this as soon as possible. Let us know if you need a build, console logs, or any other info.
Best regards,
Alex

Did this end up going anywhere? We just abruptly stopped working with very similar symptoms on our end this afternoon.

I am having the same issue, having a valid license but the application is throwing this error started today…

We experienced the same issue here, but it has since been resolved

We seem to find ourselves on the right side of this issue now as well. No more users reporting failures. Still curious if tech support is able to provide any explanation on what broke things.

Hello Alex,

I can see that your key is from an environment variable. Are you certain the key is being passed into the constructor in your production environment? The error suggests the key is missing when you instantiate the viewer. There hasn’t been any change on license validation on our end.

I believe this was due to the internet crash a few days ago.

Still facing same issue. any solution to this ?