Sudden spike in function errors "fromStdin" undefined

Hey community!

I haven’t updated a function in several months and today it’s experienced severe downtime.

Error:3:31 cannot read property 'fromStdin' of undefined
    at run_default (function.mjs:3:31)
    at run2 (function.mjs:420:10)
    at <anonymous> (eval_script:1:37)

Cart transform, 2024-01

Started Nov5th with no updates to the code.

I also can’t find all of the available versions, the docs on Shopify reference 2023-10 but this can’t possibly be in-use now.

This could be caused by a bump of the @shopify/shopify_function npm package, and a mismatch between the javy version.

Updating to the latest version of the shopify cli and redeploy should hopefully resolve your issue.

npm install -g @shopify/cli@latest
3 Likes

Tested and re-deployed several times, but still persisting.

Merchant is really stressing about this and I’m lost at what to do.

Can I DM you the function ID?

Feel free to send me the function ID so I can take a look at what’s happening.

Can you run shopify --version to verify it’s using the right CLI version when you’re deploying the change? Are you deploying from your personal computer, or deploying from a CI/CD environment?

I would also suggest testing using the Function runner by doing shopify app function run in the extensions directory. That will use the WebAssembly file directly after it’s built to verify that it’s working properly.

1 Like

Same problem: “cannot read property ‘fromStdin’ of undefined”
Not sure what is happening… any help will be more than appreciated!

Tested locally… this is the result:

Can you verify that you’re on the latest version of the Shopify CLI

npm install -g @shopify/cli@latest

And that you’re on the latest version of the @shopify/shopify_function npm package

npm update @shopify/shopify_function

Yes, I have run both commands and same result. These are my Shopify CLI and node versions:
@shopify/cli/3.66.1 darwin-arm64 node-v22.8.0

Can you verify the version of the @shopify/shopify_function npm package, not the node version. It should be in your package.lock or yarn.lock depending on package manager you’re using. The latest version is 1.0.2

Yes! Now it works! Thanks a lot!! :wink:

1 Like