Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Shopify dev fails for rust functions, CLI versions >3.70.0 #5025

Closed
2 tasks done
mcanaleta opened this issue Dec 4, 2024 · 1 comment
Closed
2 tasks done
Labels
Type: Bug Something isn't working

Comments

@mcanaleta
Copy link

Please confirm that you have:

  • Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
  • Reproduced the issue in the latest CLI version.

In which of these areas are you experiencing a problem?

Function, Extension

Expected behavior

Running npm run dev should in an app with Rust extensions, for example a Delivery Customization shoul work and deploy the working version in the development environment.

Actual behavior

Instead, an error shows in the console, even after successfully compiling the extension (cargo build, etc...):

Error while updating drafts: failed to compile WebAssembly module

I checked different CLI versions, and it works correctly until version 3.70.0.

Looking at the source code it looks like this is just what the DeveloperPlatformClient.updateExtension graphql mutation returns in userErrors:

if (mutationResult.extensionUpdateDraft?.userErrors && mutationResult.extensionUpdateDraft?.userErrors?.length > 0) {

Verbose output

Verbose output
2024-12-04T14:01:03.142Z: Sending "Partners" GraphQL request:
mutation ExtensionUpdateDraft($apiKey: String!, $registrationId: ID!, $config: JSON!, $context: String, $handle: String) {
extensionUpdateDraft(
  input: {apiKey: $apiKey, registrationId: $registrationId, config: $config, context: $context, handle: $handle}
) {
  userErrors {
    field
    message
    __typename
  }
  __typename
}
}

With variables:
{
"apiKey": "*****",
"config": "{\"title\":\"pickup-points-generator\",\"module_id\":\"3f6107a7-c55e-478f-9d6d-2417c5bdac19\",\"app_key\":\"c75cba3cb6a52e5639ecd43df5854fdf\",\"api_version\":\"unstable\",\"ui\":{\"app_bridge\":{\"details_path\":\"/\",\"create_path\":\"/\"}},\"enable_creation_ui\":true,\"localization\":{},\"targets\":[{\"handle\":\"purchase.pickup-point-delivery-option-generator.fetch\",\"export\":\"fetch\",\"input_query\":\"query Input {\\n  deliveryAddress {\\n    countryCode\\n    longitude\\n    latitude\\n  }\\n}\\n\"},{\"handle\":\"purchase.pickup-point-delivery-option-generator.run\",\"export\":\"run\",\"input_query\":\"query Input {\\n  fetchResult {\\n    status\\n    body\\n  }\\n}\\n\"}],\"uploaded_files\":{\"dist/index.wasm\":\"QUdGemJRRUFBQUFCOG9HQWdBQWhZQUFBW....
"handle": "pickup-points-generator",
"context": "",
"registrationId": "748079939585"
}

With request headers:
- User-Agent: Shopify CLI; v=3.71.2
- Keep-Alive: timeout=30
- Sec-CH-UA-PLATFORM: darwin
- Content-Type: application/json

to https://partners.shopify.com/api/cli/graphql

Error while updating drafts: failed to compile WebAssembly module

Reproduction steps

Just run any of the documentation samples, for example https://shopify.dev/docs/apps/build/discounts/build-discount-function?extension=rust[](url)

Operating System

Mac OS Sonoma

Shopify CLI version (shopify --version)

@shopify/cli/3.71.2 darwin-arm64 node-v22.12.0

Shell

Zsh

Node version (run node -v if you're not sure)

v22.12.0

What language and version are you using in your application?

rustc 1.83.0 but I tried multiple old versions

@mcanaleta mcanaleta added the Type: Bug Something isn't working label Dec 4, 2024
@mcanaleta
Copy link
Author

mcanaleta commented Dec 4, 2024

Ok just 1 hour after opening this issue, the version 3.71.3 was released with a fix. I checked and its working. That was fast!

Closing the issue, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant