Cart Transform (JS) function fails to build — "doesn't have a build command" even with command = "", and generate extension --template cart_transform fails separately with a codegen error

Hi everyone, My name is Mickael,

First post here — I’m building a custom app for my own store to merge related cart line items (a “host” product + its selected component products) into a single grouped display, using a Cart Transform Function with the merge operation. I’ve run into two build issues in a row and can’t get past them despite checking the docs carefully. Any pointers would be much appreciated!

Environment:

  • OS: Windows 10 Home (10.0.19045)
  • Node.js: v24.21.0
  • npm: 11.19.0
  • pnpm: 12.5.1
  • Shopify CLI: tested both 4.8.0 (latest) and 4.7.1 — identical result on both
  • App scaffolded via shopify app init --template none (extension-only template)

Issue 1 — shopify app generate extension --template cart_transform fails before finishing:

Generating function extension ...
Building GraphQL types ...
Error: ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL
  × Command "graphql-code-generator" not found

Error coming from `pnpm exec graphql-code-generator --config C:/Users/.../tmp-XXXX/codegen.json`

Reproduced 3 times in a row (both --flavor typescript and --flavor vanilla-js), always the same error at the “Building GraphQL types” step. pnpm build-script approvals were already granted via pnpm-workspace.yaml (allowBuilds: { esbuild: true, core-js: true }) before retrying, so it’s not the usual ERR_PNPM_IGNORED_BUILDS issue.

Issue 2 — after hand-writing the extension (since the generator won’t complete), shopify app build / shopify app function build reject a build config that matches your own documentation:

extensions/grouper-configurations/shopify.extension.toml:

api_version = "2026-07"

[[extensions]]
name = "Cart grouping"
handle = "grouper-configurations"
type = "function"

[[extensions.targeting]]
target = "cart.transform.run"
input_query = "src/cart_transform_run.graphql"
export = "cartTransformRun"

[extensions.build]
command = ""
path = "dist/function.wasm"

This mirrors the structure of Shopify/discounts-reference-app’s examples/javascript/default/extensions/discount-function/shopify.extension.toml, which also uses command = "" for automatic Javy compilation. Running shopify app build gives:

The function extension grouper-configurations doesn't have a build command or it's empty
    Edit the shopify.function.extension.toml configuration file and set how to build the extension.
    [build]
    command = "{COMMAND}"
    Note that the command must output a dist/index.wasm file.
Build step "Build Function" failed: Failed to build function.

Also tried: omitting [extensions.build] entirely (same error), and path = "dist/index.wasm" instead of dist/function.wasm (same error). The error text itself also references a different filename (shopify.function.extension.toml) than the one the CLI actually reads (shopify.extension.toml), which may be a leftover from an older config convention.

Question: is command = "" for automatic Javy compilation still supported in CLI 4.7.x/4.8.x, or does the JS Function build path now require an explicit command? If so, what’s the correct one for a hand-written (non-generated) extension?

Thanks in advance for any help!

Hi @Mickael_Hoareau,

For Issue 1, the generator error matches a pnpm workspace dependency-resolution issue. To resolve it, run this from the app root:

pnpm add --save-dev --workspace-root --save-exact @graphql-codegen/cli@5.0.5 @graphql-codegen/typescript@4.1.6 @graphql-codegen/typescript-operations@4.6.0

Then rerun the extension generator.

For Issue 2, change this in the shopify.extension.toml:

export = "cartTransformRun"

to:

export = "cart-transform-run"

Also confirm that src/index.js exists and contains:

export * from './cart_transform_run';

Shopify CLI uses that entry file to recognize the automatic JavaScript build. The empty build command does not need replacing.

Hope that helps! Let me know if you’re still running into issues.

Hi Paige,

Thanks a lot for your help, it’s working now!

Regards,

Mickael