'instance' is not defined

Which product are you using?

PDF.js-based viewer

PDF.js Express Version

^8.1.1

Detailed description of issue
{Description here}
Hello, Mr. Logan, I am a student trying to learn how to use pdF.js viewer. My project is the React project written with TS. When I tried to manipulate the viewer using the config.js file, the error “‘instance’ is not defined” occurred and the configuration in the file did not take effect. How do I edit the config.js file? Can you provide a demo for my reference? Thanks a million!

Expected behaviour
{Provide a screenshot or description of the expected behaviour}

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}
image
image
image
image

I tried to write this, but the configuration didn’t work either.
image

LisenceKey is registered for the online domain, but is disabled.


Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hey there!

That is a Typescript issue and not an issue with Express. You’ll need to create a global typescript declaration file and assign instance as a global variable. This is something that we cannot do from within the library.

Thanks,
Logan