Error when trying to setup Pdftron (build with Rails and Vite)

Product: Pdftron Webviewer

Product Version: 8.9.0

Please give a brief summary of your issue:
I am experiencing trouble trying to set up pdftron in a build with Rails and Vite.


I am using pdftron with Vue, this is the code I use to fire the Webviewer

  WebViewer({
          path: "/pdf-webviewer/",
          documentType: "pdf",
          extension: "pdf",
          initialDoc : "...file.pdf"
        }, document.getElementById(this.id))
          .then(async instance => {
            console.log("in instance", instance);
            const {UI, Core} = instance;
            console.log("UI : ", UI);
            console.log("Core : ", Core);

          });

Can you help me finding out what is going on? I am a bit lost at the moment.
What information can I provide to identify the issue?

Hi,

If you’re using Webviewer with Vue, you can check the sample source code at: GitHub - PDFTron/webviewer-vue-sample: Sample to demonstrate integrating WebViewer into Vue.

Could you try using ref to an element instead using document.getElementById as the Webviewer viewerElement?

To further investigate the issue, could you send us a minimal project (or a link of the project) where the issue can be reproduced? Thank you.

I am sorry, it was my bad.

I have called the folder “pdf-webviewer”, i created it and moved the files in manually. I also pointed the script to boot the webviewer correctly.
Then I have done some work and after that I pasted the “move-static” command suggested in the documentation in the package.json to have the command always at hand.
This command though points to “public/webviewer” and I forgot to change the name.
When I did a fresh install, the move-static obviously did not do its job (because the folder was either missing or not matching anyway) and so the chunk could not be fetched.

Following the video you suggested I noticed that he copied the files manually, and it’s at that point that I noticed the mismatch in the naming.

Thanks, this solved my issue :slight_smile:
The topic can be closed, sorry again.

Hi,

glad to know the issue is resolved, I’m closing this ticket.