Deployed function for the first time to staging and now getting
Error:8:11 ShopifyFunction is not defined. Please rebuild your function using the latest version of Shopify CLI.
at run_default (function.mjs:8:11)
at run2 (function.mjs:98:10)
at <anonymous> (eval_script:1:37)
Same code works well for the development app but fails for the staging app.
Still no luck @Liam-Shopify. I have three .toml file for my app and my work flow is as below:
I am using the latest cli client:
@shopify/cli/3.82.0 darwin-x64 node-v20.18.1
I develop using the shopify.app.toml file, created the function, built, deployed, works.
I then switch to shopify.app.staging.toml file, deployed the app, didn’t work. After a few deploys, started working without any code changes.
I then switch to shopify.app.live.toml file, deployed the app. The deployment process did build the function, deployed it, but then keeps giving me the same error.
I then removed the extension directory, generated a brand new extension, deployed it, same error.
I then manually shopify app function build, got javy confirmation that the function is built, deployed it and still getting the same exact error.
Error:8:11 ShopifyFunction is not defined. Please rebuild your function using the latest version of Shopify CLI.
at run_default (function.mjs:8:11)
at run2 (function.mjs:28:10)
at <anonymous> (eval_script:1:37)
What version of the @shopify/shopify_function package are you using? Also if you run the function locally with shopify app function run - what happens?