unknown import:shopify_function_v2::shopify_function_output_new_object` has not been defined

When I try to deploy, I get the error message “unknown import:shopify_function_v2::shopify_function_output_new_object` has not been defined”.

shopify version 3.89.0

Cargo.toml
[package]
name = “cart-transformer-rust”
version = “1.0.0”
edition = “2021”

[dependencies]
shopify_function = “2.0.2”
serde_json = “1.0”

[profile.release]
lto = true
opt-level = ‘z’
strip = true

shopify.extension.toml
api_version = “2025-07”

[[extensions]]
name = “t:name”
handle = “cart-transformer-rust”
type = “function”
uid = “892340e2-cd44-15eb-2086-617a480c05a65c0bdca4”
description = “t:description”

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

[extensions.build]
command = “cargo build --target=wasm32-unknown-unknown --release”
path = “target/wasm32-unknown-unknown/release/cart-transformer-rust.wasm”
watch = [ “src/**/*.rs” ]

[extensions.ui.paths]
create = “/”
details = “/”

Hey @YMQ_YMQ - this issue on our Github might have the solution for you:

If not though, can you confirm you’re using the latest version of the Shopify CLI by running shopify upgrade and in your function app’s configuration/dependencies making sure you’re using version 2.0.3 of the Rust crate for Shopify Functions?

https://crates.io/crates/shopify_function

If the issue still pops up after testing that, just ping me here and we can take a look. If you can share a verbose version of the CLI logs from a failure example by adding the --verbose flag at the end of a CLI command that would be super helpful as well. Hope this helps!

Hey @YMQ_YMQ - just following up to see if the above helped, let me know!