Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloudflare worker compatibility #2757

Open
stephtr opened this issue May 19, 2024 · 0 comments
Open

Cloudflare worker compatibility #2757

stephtr opened this issue May 19, 2024 · 0 comments

Comments

@stephtr
Copy link

stephtr commented May 19, 2024

Is your feature request related to a problem? Please describe.
When one tries to use react-pdf on Cloudflare Pages (for example in a NextJS project), generating PDFs fail with "Wasm code generation disallowed by embedder" due to security restrictions. This issue arises from yoga-layout loading a wasm script. yoga-layout is imported by @react-pdf/layout.

Describe the solution you'd like
It would be nice, if one could specify which yoga-layout version @react-pdf/layout shall load. When manually patching @react-pdf/layout to load yoga-layout/asmjs-sync instead of just yoga-layout, the above issue can be circumvented.

Describe alternatives you've considered
In case the above is out of scope, I at least wanted to write it down such that others having this issue can find a solution.

Additional context
For reference, the patch I did:
image
(same for the cjs version)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant