Node.js App Function not compiling to wasm

Topic summary

Problem: A new Node.js Shopify app built with Shopify CLI 3.x failed to compile Functions to WebAssembly on deploy. The dist folder contained only function.js, and validation errored that dist/function.wasm was missing.

Context: Prior success with similar apps. Updating/downgrading Node, npm, and Shopify CLI, and copying dependencies did not help (Node v20.1.0, npm 9.6.4, Ruby 3.2.1, CLI 3.47.5). Updating Node as suggested in another thread did not resolve it.

Root cause: Outdated or problematic javy-cli (Javy compiles JavaScript to WebAssembly for Shopify Functions).

Fix:

  • Update Javy globally: npm install -g javy-cli
  • Clear cached Javy binaries on the system (remove stored Javy binary caches)
  • Re-deploy to trigger recompilation: npm run deploy

Outcome: function.wasm was generated at extensions//dist/function.wasm and the deploy succeeded.

Status: Resolved with the Javy update and cache clear; no further open questions noted.

Summarized with AI on January 23. AI used: gpt-5.

Using the Shopify CLI 3.X, I’ve successfully created and published Checkout UI Extensions and Functions within my Node.js app. Recently, I created another app using the same process as before, but I am now hitting an error while trying to build the function and deploy to Shopify.

Specifically, when I execute “npm run deploy”, my Shopify Functions are not compiling to wasm. In the extensions//dist/ folder of my new app, there is only a function.js file and no function.wasm:

Running validation ...
Error: The function extension <function-name> hasn't compiled the wasm in the expected path: /Users/<user>/Documents/projects/shopify/<app-name>/extensions/<function-name>/dist/function.wasm

I saw another post here with the same bug, but their solution of updating the Node version did not resolve the error. I have tried upgrading and downgrading versions of Node, npm, and the Shopify CLI. I have also tried editing the package.json and package-lock.json to manually copy dependencies from my previous app, where this functionality was working. Any ideas how to move forward?

Node version: v20.1.0

npm version: 9.6.4

ruby version: 3.2.1

Shopify CLI version: 3.47.5

With help from the Shopify dev team, we identified that the root of the issue was the javy-cli version. To address this error:

  • Update the javy-cli installation:
npm install -g javy-cli​
  • Remove any stored javy binary caches from your system:
rm -rf /Users/
- Now try re-compiling your Function by deploying the app to Shopify:

```markup
npm run deploy​

Voila! Web assembly should successfully be compiled in dist/function.wasm :slightly_smiling_face: