question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Broken CSS Build in pdfjs-dist (v2.15.349)

See original GitHub issue

Configuration

  • PDF.js version: v2.15.349

What went wrong? (add screenshot)

There seems to be a new image import images/toolbarButton-editorInk.svg in

I can find this svg file in the pdfjs github page assets, but neither pdfjs-dist/legacy/web/images nor pdfjs-dist/web/images are updated with the svg file in v2.15.349.

It is causing weird build issue on pdfjs-dist.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
phloosecommented, Aug 17, 2022

Sorry, but I don’t consider this CSS-only issue serious enough to warrant creating a new release immediately

Hmm this means, you consider a failing build for a lot of users not serious enough to release a new version that fixes this issue?! Sounds a bit harsh to me… What is the culprit here? What would take so much time to make sure the file exists or the path is correct? A patch for this would surely help a lot of users

4reactions
donaruscommented, Aug 6, 2022

Sorry, but I would disagree. I agree that it would not make sense to release the new version with all the other (and potentially untested) features and fixes. But on the other side, this may be blocking issues for many other related projects and the fix could be created from the actual release branch just patching it by adding the mentioned file to the correct place and rerelease it for example under 2.15.400 or 2.15.349.2. But if this solution is not a way, tell me a reason why please.

Until fixed, we figured out how to get over it by using the simple hack for NPM based builds:

package.json

{
  ...
  "scripts": {
    .....
    "postinstall": "node postinstall-fixes.js"
  },
  ...
}

postinstall-fixes.js

const file = fs.createWriteStream("./node_modules/pdfjs-dist/legacy/web/images/toolbarButton-editorInk.svg");
const request = https.get("https://raw.githubusercontent.com/mozilla/pdf.js/edc9ad13bf8f422f9495c4ede9bb9989969326e4/web/images/toolbarButton-editorInk.svg", function(response) {
   response.pipe(file);
   file.on("finish", () => {
       file.close();
   });
});

But still, it would make sense to fix this issue because many others would need to solve it somehow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pdfjs-dist
Our goal is to create a general-purpose, web standards-based platform for parsing and rendering PDFs. This is a pre-built version of the PDF.js...
Read more >
mozilla/pdf.js v2.6.347 on GitHub
New release mozilla/pdf.js version v2.6.347 on GitHub. ... #11964 Fix pdfjs-dist/webpack causing errors with certain configs
Read more >
Using pdf.js to render a PDF but it doesn't work and I don ...
Where Is Your Viewer / You Don't Need iFrame or Canvas. PDFJS just needs a div to place the PDF inside of. It's...
Read more >
Is it possible to style the built in pdf.js viewer using CSS ...
Is it possible to style the built in pdf.js viewer using CSS/modify in general? 2 replies; 1 has this problem ...
Read more >
How to Use PDF.js in 2 Easy Steps
Get step-by-step direction on how to use a PDFjs Viewer in your website to display PDFs. Step 1: download & extract PDFjs package....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found