Unable to load pdftron using yarn build

Hi,
We are trying to explore PDFTron to use in our application.

Usage In: React Application 4+ years old
React version: 17.0.1
Webpack version: 5
Build mechanism via: babel
WebViewer Version: “@pdftron/webviewer”: “8.7.0”

We are facing exactly the same issue in PDFTron Systems Inc. | Documentation when we perform yarn build. Same is working fine in yarn start.

Via webpack copy – we are copying static assets

After yarn start , loading fine:

After yarn build, received error as below:

Build folder structure:

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:

Hi,

For the webpack copy, is it also used when running yarn start?

Wanbo

Hi,

Please find the updates below:

For yarn start we are using same webpack copy logic. Client and server port is different for yarn start{ex: client :3030, server: 9090]

yarn build – Client and server port is same.[Ex:9090].

After yarn build and copy we receive below error:

If we change index.html to index_1.html its working under copied static ui folder, It’s working.

Could you kindly suggest how to proceed further on this issue.

Hi,

May I know which index.html are you referring to? Also it’s weird that renaming to index_1.html makes it working. Maybe you can investigate and see how the renamed file is loaded.

Wanbo

Hi,

We are trying to load static asset into our s3 bucket and try to access from the same. We have even updated the configorigin.txt in UI folder. But our instance is still undefined. We even following PDFTron Systems Inc. | Documentation but we are unable to succeed.

What we need to do with config file. Can we get some support via chat or sample app to explore your product.

Thanks,
Sathyavathi D N

Hi,

Please try the links below for online sample and demo.
https://www.pdftron.com/samples/web/samples/viewing/viewing/
https://www.pdftron.com/webviewer/demo

Thanks.

Wanbo