Hello,
Upgrading @shopify/cli from 4.2.0/4.3.0 to 4.4.0 or later roughly doubles the compiled dist/function.wasm size for JavaScript Functions — same source, no code changes. For a Function that was comfortably under the limit, this pushes it over Shopify’s hard 256KB cap, and shopify app deploy fails with the message: Version couldn’t be created.
Validation errors:
• base: Wasm file size must be less than 256KB
Reproduction (identical source, only the CLI version differs)
| Function | CLI 4.2.0 / 4.3.0 | CLI 4.5.2 |
|---|---|---|
| discount function | 181 KB |
367 KB |
| rules-engine function | 108 KB |
204 KB |
Both JS Functions ~2× on 4.5.x. Rust Functions and small JS Functions are affected proportionally; the increase looks like a larger embedded runtime baseline, independent of app code.
Likely cause:
CLI 4.4.0 shipped Shopify/cli#7871 — “Update Javy related dependencies” — which bumped the Functions build plugin shopify_functions_javy_v3.wasm → v4.wasm. Since Shopify Functions require a single self-contained (statically linked) WASM module, a larger embedded QuickJS runtime in that plugin inflates every JS Function’s output regardless of source. Nothing else between 4.2.0 and 4.4.0 touches Javy per the changelog. wasm_opt is already on by default and doesn’t offset it.
Question:
- Is the 4.4.0 Javy plugin size increase a known/expected regression, and is a smaller build planned
- For JS Functions near the 256KB cap on current CLI, is Rust migration the only path, or is there a supported way to reduce Javy output size (a build flag, dynamic linking, etc.)?
Thanks,
M