3D FlipBook - Custom Build with Fixed Asset URLs (Shopify)

m***w@lemonade.nyc
2021-03-04
2021-03-14

I'm trying to load this into a Shopify site, but there is no option to created subfolders for all the asset files (/js, /images, /fonts, etc). Instead, all files get added to a global /assets folder on a CDN so I have an absolute path to those files.

I know I can define the paths with this…

window.PDFJS_LOCALE = {
  pdfJsWorker: [CDN Path],
  pdfJsCMapUrl: [CDN Path]
};    

…but I'm getting a lot of console errors when loading this file.

ERROR: "Uncaught TypeError: Cannot read property 'GlobalWorkerOptions' of undefined"

How do I solve this? Do I need to change values in the source?

Replies

a***r@3dflipbook.net
2021-03-05
2021-03-05

GlobalWorkerOptions error goes from initialization pdfjslib pdf.min.js. It should be included before 3dflipbook.min.js. see example https://3dflipbook.net/embedded-video

m***w@lemonade.nyc
2021-03-05
2021-03-05

Thanks for the quick reply. I combined ALL the js for each of these required files into a single file to ensure there isn't any loading order issues, but I'm still getting the error. I did purchase the premium level package and when downloading it I noticed it has two folders (common and the 3dflip folder), but I'm not sure what to use here. It's not clearly outline in the README file what steps need to be taken in order to load this properly. I've looked at the example scenario and copied that exactly, but still having issues.

You can view the file here: https://cdn.shopify.com/s/files/1/0077/0234/7887/t/3/assets/pdf-combined.min.js?v=1316799983034129996

Please help.

a***r@3dflipbook.net
2021-03-14
2021-03-14

There is not jQuery in the bundle, it should be init first. see this example https://3dflipbook.net/embedded-video for the right script order and define the worker path https://3dflipbook.net/documentation#using-in-frameworks

Log In to leave a comment