Eliminate WordPress Errors: How JSPI Can Fix Chrome Crashes and Boost Performance
Are you experiencing frustrating crashes while using WordPress on Chrome, especially with WooCommerce or HPOS enabled? Do "unreachable WASM instruction executed" errors sound familiar? The issue might stem from Asyncify, a technology used to run asynchronous JavaScript functions within WebAssembly. Fortunately, a solution is on the horizon: JSPI.
The Asyncify Problem: Why WordPress Crashes Happen
Asyncify requires a comprehensive list of all C functions potentially active during asynchronous calls. Missing even one function in this list leads to those dreaded fatal crashes. Users are frequently reporting these issues, making a solution crucial.
Common issues and errors related to Asyncify include:
- WooCommerce crashes
- Inability to place orders with HPOS enabled
- Asyncify errors related to null function or signature mismatches
- Shutdown errors
JSPI: A New Hope for Faster, More Stable WordPress
JSPI (JavaScript Promise Integration) offers a modern alternative. It eliminates the need for the exhaustive function list required by Asyncify, resulting in:
- Smaller, faster binaries
- Fewer crashes related to asynchronous calls
- A more stable WordPress experience
Gradual Rollout: JSPI for Chrome Users First
While complete and universal support for JSPI across all browsers and runtimes is still some time away (potentially a year or more), the team is taking a proactive approach.
Here's the plan:
- Chrome Origin Trial: Enable JSPI on Chrome via origin trial for testing and feedback.
- Dual Bundles: Build both Asyncify and JSPI versions of the core bundle.
- Targeted Deployment: Serve the JSPI version to Chrome users and the Asyncify version to all others.
- Continued Asyncify for Node.js: Maintain Asyncify for Node.js for the time being.
Benefits of This Approach
This phased rollout delivers immediate benefits:
- Reduced Crashes: Fewer Chrome users will encounter Asyncify-related crashes.
- Seamless Upgrades: As other browsers adopt JSPI, upgrading users will be straightforward.
Current JSPI Support (April 29, 2024)
JSPI is currently supported on:
- ✅ Google Chrome (with
#enable-experimental-webassembly-jspi
enabled inchrome://flags
, or through a JSPI origin trial). - ✅ Node.js v22+ (with the
--experimental-wasm-stack-switching
flag). - ✅ Firefox Nightly.
- ❌ Safari, older browsers.
- ❌ Bun, Node.js <= 21.
- ❔ Chrome-based browsers (status uncertain).
How to try JSPI today
If you are a developer or tech-savvy user, you can manually enable JSPI in Chrome to experience the benefits early
- Open Chrome and type
chrome://flags
in the address bar. - Search for "WebAssembly JSPI".
- Enable "WebAssembly JSPI".
- Restart Chrome.
For Node.js, use the --experimental-wasm-stack-switching
flag when running your application.
The Future is Faster: Looking Ahead to Widespread JSPI Adoption
By strategically deploying JSPI to Chrome users, the team is paving the way for a more stable, performant WordPress experience. As browser support expands, expect to see even greater improvements in speed and reliability across all platforms. Stay tuned for further updates on JSPI implementation and wider availability!