App function extension not compiling to wasm. Possible bug?

I’m trying to set up a javascript app extension/function using the discount tutorial here:

https://shopify.dev/docs/apps/selling-strategies/discounts/experience/getting-started

And I’m unable to get past step #1 part 8 to deploy the app (npm run deploy). Specifically, I’m getting an error that says:

The following function extensions haven’t compiled the wasm in the expected path:> > product-discount: extensions/product-discount/dist/function.wasm> > Make sure the build command outputs the wasm in the expected directory.

It’s clearly looking for a wasm file, but when I run the build command (npm run build) it outputs a javascript file in the dist folder instead of a wasm file. **extensions/product-discount/**dist/function.js. Is this a bug or is there something missing from the tutorial? Should I be building in a different way than the included node command? There is no mention of building in the tutorial.

Details:

I used thenpm init @Shopify_77 [email removed]command from this tutorial to build a node app.

https://shopify.dev/docs/apps/getting-started/create

The app was successfully installed on my dev store and otherwise works fine.

Node version 14.19.0

NPM version 9.6.6

Shopify CLI version 3.45.4

Any help would be appreciated. Thanks.

1 Like

I upgraded to Node 20.1.0 and it compiled correctly. The docs say the minimum required Node version is 14.17.0. That should be updated.

1 Like