SelangeJR
SelangeJR

Reputation: 11

Electron : window['pdfjs-dist/build/pdf.hjs'] undefined

17/08/2021, no issues.

18/08/2021: For some reason overnight, there has been 0 changes in the code itself,

const pdfjsLib = window['pdfjs-dist/build/pdf']

pdfjsLib.GlobalWorkerOptions.workerSrc = '//mozilla.github.io/pdf.js/build/pdf.worker.js'

pdfjsLib stays undefined in the Electron app version of the application.

However, in the browser version, there is still no issue.

Hence, we can't work with PDFs anymore in the app. Who can explain how it suddenly doesn't work anymore after 1 year, and even better, who has a solution for this?

Upvotes: 1

Views: 2316

Answers (1)

Giampaolo Ferradini
Giampaolo Ferradini

Reputation: 587

I think you are having the same issue that prompted my SO question last year: as mentioned here you "You should never directly link to mozilla.github.io/pdf.js since it changes on every push to master."

Not that a direct install is flawless, mind you: I came here today to ask about it again, and your question came up for a possible duplicate before posting.

Upvotes: 1

Related Questions