Closed ivarec closed 1 year ago
also running into this, and see one here: https://community.cloudflare.com/t/pdfjs-dist-npm-package-not-working/483435
Thanks for reporting this! It doesn't look like the pdf.js
library is supported in the Cloudflare Workers environment. Going forward, the Workers runtime is working on adding support for more Node.JS builtins, which should improve library compatibility.
There's now https://github.com/unjs/unpdf, which should work with Workers (with a few limitations)
For posterity, I was able to get this wrapped version of pdfjs to work. https://github.com/johannschopplich/pdfjs-serverless
Which Cloudflare product(s) does this pertain to?
Wrangler
What version of
Wrangler
are you using?2.17.0
What operating system are you using?
Windows
Describe the Bug
If I try to use
pdf.js
in a Cloudflare Worker,wrangler publish
fails with the following stack trace:I can easily reproduce it with the following minimal code (after installing
pdf-dist
from npm):