You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apologies if this is just caused by my own error or unfamiliarity with npm, but when trying to recreate the Playground locally I ran into a bunch of problems... and then sorted them out by making a very small change to the code.
I kept getting 404s and failed fetch requests on "logo.pdf" and "opensans.ttf" until I opened playground.js and saw that on lines 100-103 the paths are absolute:
...and after repeating the npm build process it worked fine. I think this isn't a problem on http://pdfjs.rkusa.st/ because there it is in a root directory, but when running it in a folder it causes an error that stops the whole thing from working. Again, sorry if this is the kind of thing that doesn't present a problem for more experienced developers, but I in my noob-ness got really hung up on it for a while before I discovered the cause.
The text was updated successfully, but these errors were encountered:
You are right, fetching the assets from root will cause an error when opening the playground from e.g. a file:/// path. When I test the playground locally I usually do the following:
Hi,
Apologies if this is just caused by my own error or unfamiliarity with npm, but when trying to recreate the Playground locally I ran into a bunch of problems... and then sorted them out by making a very small change to the code.
I kept getting 404s and failed fetch requests on "logo.pdf" and "opensans.ttf" until I opened playground.js and saw that on lines 100-103 the paths are absolute:
So I changed them to relative paths:
...and after repeating the npm build process it worked fine. I think this isn't a problem on http://pdfjs.rkusa.st/ because there it is in a root directory, but when running it in a folder it causes an error that stops the whole thing from working. Again, sorry if this is the kind of thing that doesn't present a problem for more experienced developers, but I in my noob-ness got really hung up on it for a while before I discovered the cause.
The text was updated successfully, but these errors were encountered: