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

Support cloudflare worker runtime #22

Open
enpitsuLin opened this issue Dec 1, 2024 · 0 comments
Open

Support cloudflare worker runtime #22

enpitsuLin opened this issue Dec 1, 2024 · 0 comments

Comments

@enpitsuLin
Copy link

enpitsuLin commented Dec 1, 2024

Currently, the WASM files are embedded as gzipped base64 strings in the module. However, this approach is not compatible with Cloudflare Workers runtime and causes errors when using Wrangler.

image

Cloudflare Workers only supports direct WASM imports. cloudflare/workers-sdk#1366

As a workaround, I've implemented a solution by:

  1. Dumping WASM from hardcoded values
  2. Adding a polyfill for loadWasm logic

like:
image

While this works for basic WASM modules, it doesn't work properly for RSA implementations that depend on rsa_bg.js. I haven't found a solution for this besides using package patches.

Would it be possible to provide the raw WASM files instead of embedding them as gzipped base64 strings? This would improve compatibility with bundlers that support WASM directly.

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

No branches or pull requests

1 participant