You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running npx wrangler publish throws the following error:
β [ERROR] A request to the Cloudflare API (/accounts/.../workers/scripts/api) failed.
Uncaught Error: CompileError: WebAssembly.Module(): Wasm code generation disallowed by embedder
at line 0
[code: 10021]
I'm not using wasm things myself but perhaps some dependency is? I'm not sure where to look. Also, it's hard to debug the build with publish --dry-run --outdir=build because there is no line 0. I've tried this with node v18.0.0 as well as node v18.4.0. I've also tried both true and false for node_compat; same thing.
Searching for wasm things in the project returns this:
After digging a little deeper, I see the following in the build:
var A = new WebAssembly.Instance(new WebAssembly.Module(Uint8Array.from(atob("AGFzbQEAAAABCgJgAABgAn9/AXwDAwIAAQUDAQACBwkCAW0CAAFjAAEIAQAKlQECSQEDfwNAIAEhAEEAIQIDQCAAQQF2IABBAXFBoIbi7X5scyEAIAJBAWoiAkEIRw0ACyABQQJ0IAA2AgAgAUEBaiIBQYACRw0ACwtJAQF/IAFBf3MhAUGAgAQhAkGAgAQgAGohAANAIAFB/wFxIAItAABzQQJ0KAIAIAFBCHZzIQEgAkEBaiICIABJDQALIAFBf3O4Cw"), (n2) => n2.charCodeAt(0))));
That library client-zip appears to have been written for node.js, which has different assumptions and apis.
A work around would be to swap out that library for one that does work on workers, or rewrite the module. This seems like a discussion for our community resources like discord, so I'm going to close this issue, but happy to discuss if you need more clarification.
What version of
Wrangler
are you using?2.0.15
What operating system are you using?
macos catalina 10.15.7
Describe the Bug
Running
npx wrangler publish
throws the following error:I'm not using wasm things myself but perhaps some dependency is? I'm not sure where to look. Also, it's hard to debug the build with
publish --dry-run --outdir=build
because there is noline 0
. I've tried this with node v18.0.0 as well as node v18.4.0. I've also tried bothtrue
andfalse
fornode_compat
; same thing.Searching for wasm things in the project returns this:
Update:
After digging a little deeper, I see the following in the build:
This is coming from a dependency,
client-zip
:https://github.com/Touffy/client-zip/blob/master/src/crc32.ts
The text was updated successfully, but these errors were encountered: