Node.js App Function not compiling to wasm

Solved
whackett
Shopify Partner
2 1 0

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/<function-name>/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

Accepted Solution (1)
whackett
Shopify Partner
2 1 0

This is an accepted solution.

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/<user>/Library/Caches/binarycache/* ​
  • Now try re-compiling your Function by deploying the app to Shopify:
npm run deploy​

 

 

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

View solution in original post

Reply 1 (1)
whackett
Shopify Partner
2 1 0

This is an accepted solution.

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/<user>/Library/Caches/binarycache/* ​
  • Now try re-compiling your Function by deploying the app to Shopify:
npm run deploy​

 

 

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