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]: issue with running npm run deploy. #2626

Closed
2 tasks done
hailong111 opened this issue Aug 8, 2023 · 45 comments
Closed
2 tasks done

[Bug]: issue with running npm run deploy. #2626

hailong111 opened this issue Aug 8, 2023 · 45 comments
Labels
Type: Bug Something isn't working

Comments

@hailong111
Copy link

hailong111 commented Aug 8, 2023

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

Expected behavior

It should work without error and can deploy it.

Actual behavior

The main error is : Error coming from npm exec -- javy compile -d -o /Users/Mao/Development/Shopify-function-app/apps/extensions/shipping-rate/dist/function.wasm dist/function.js

And it does not have file function_wasm dist/function.js in the dist folder, which only has function.js.

The verbose running result:

 npm run deploy -- --verbose 

> apps@1.0.0 deploy
> shopify app deploy --verbose

2023-08-08T13:13:38.346Z: Running command app deploy
2023-08-08T13:13:38.399Z: Reading cached app information for directory /Users/Mao/Development/Shopify-function-app/apps...
2023-08-08T13:13:38.400Z: Reading the content of file at shopify.app.toml...
2023-08-08T13:13:38.402Z: Reading the content of file at shopify.app.toml...
2023-08-08T13:13:38.405Z: Reading the content of file at shopify.app.toml...
2023-08-08T13:13:38.407Z: Reading the .env file at .env
2023-08-08T13:13:38.407Z: Reading the content of file at .env...
2023-08-08T13:13:38.410Z: Reading the content of file at extensions/shipping-rate/shopify.function.extension.toml...
2023-08-08T13:13:38.413Z: Reading the content of file at package.json...
2023-08-08T13:13:38.413Z: Reading the content of file at package.json...
2023-08-08T13:13:38.414Z: Obtaining the dependency manager in directory /Users/Mao/Development/Shopify-function-app/apps...
2023-08-08T13:13:38.418Z: Reading the content of file at web/shopify.web.toml...
2023-08-08T13:13:38.422Z: Reading the content of file at package.json...
2023-08-08T13:13:38.424Z: Ensuring that the user is authenticated with the Partners API with the following scopes:
[]

2023-08-08T13:13:38.427Z: Getting session store...
2023-08-08T13:13:38.428Z: Validating existing session against the scopes:
[
  "openid",
  "https://api.shopify.com/auth/shop.admin.graphql",
  "https://api.shopify.com/auth/shop.admin.themes",
  "https://api.shopify.com/auth/partners.collaborator-relationships.readonly",
  "https://api.shopify.com/auth/shop.storefront-renderer.devtools",
  "https://api.shopify.com/auth/partners.app.cli.access",
  "https://api.shopify.com/auth/destinations.readonly"
]
For applications:
{
  "partnersApi": {
    "scopes": []
  }
}

2023-08-08T13:13:38.429Z: Sending GET request to URL https://accounts.shopify.com/.well-known/openid-configuration.json
With request headers:
 - User-Agent: Shopify CLI; v=3.48.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

2023-08-08T13:13:38.731Z: Request to https://accounts.shopify.com/.well-known/openid-configuration.json completed in 292 ms
With response headers:
 - cache-control: no-cache, no-store, private, must-revalidate, max-age=0
 - content-type: application/json; charset=utf-8
 - etag: W/"1eb4e9d462ffcdab29ed596345fa4cb0"
 - x-request-id: f4c6f45a-fe8c-4c1b-bdc4-650462cd7f71
    
2023-08-08T13:13:38.759Z: Sending Identity Introspection request to URL: https://accounts.shopify.com/oauth/introspection
2023-08-08T13:13:38.759Z: Sending POST request to URL https://accounts.shopify.com/oauth/introspection
With request headers:
 - User-Agent: Shopify CLI; v=3.48.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

2023-08-08T13:13:38.886Z: Request to https://accounts.shopify.com/oauth/introspection completed in 125 ms
With response headers:
 - cache-control: no-cache
 - content-type: text/html
 - x-request-id: 4fcd76ea-36e2-4a2e-a234-c611ce1421a9
    
2023-08-08T13:13:38.887Z: The Introspection request failed with:
 - status: 401
 - www-authenticate header: "error=\"invalid_token\",error_description=\"The access token provided is expired, revoked, malformed or invalid for other reasons.\""
 - body: ""
2023-08-08T13:13:38.888Z: 
The validation of the token for application/identity completed with the following results:
- It's expired: true
- It's invalid in identity: true
  
2023-08-08T13:13:38.888Z: The current session is valid but needs refresh. Refreshing...
2023-08-08T13:13:38.890Z: Sending POST request to URL https://accounts.shopify.com/oauth/token?grant_type=refresh_token&access_token=atkn_6921ea6b9bc09137241af783f7aaee80dcd4692b37b4681afb98b8f465f643a9&refresh_token=atkn_13be0fd0888be1b73e85ac47a46ede439f7b287934c32184e2c4bf0503e384ab&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3
With request headers:
 - User-Agent: Shopify CLI; v=3.48.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

2023-08-08T13:13:39.268Z: Request to https://accounts.shopify.com/oauth/token?grant_type=refresh_token&access_token=atkn_6921ea6b9bc09137241af783f7aaee80dcd4692b37b4681afb98b8f465f643a9&refresh_token=atkn_13be0fd0888be1b73e85ac47a46ede439f7b287934c32184e2c4bf0503e384ab&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3 completed in 377 ms
With response headers:
 - cache-control: no-cache, no-store, private, must-revalidate, max-age=0
 - content-type: application/json; charset=utf-8
 - etag: W/"0c19b81293d4f9814972f8845bd7e6ed"
 - x-request-id: 895bde6c-c176-43d9-bc12-148f221e6810
    
2023-08-08T13:13:39.271Z: Sending POST request to URL https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=271e16d403dfa18082ffb3d197bd2b5f4479c3fc32736d69296829cbb28d41a6&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fpartners.app.cli.access&subject_token=atkn_4ca824b0aac840a5cc5c07ce0b259c4e3f98b202da32bfbfcaf39933d875ddee
With request headers:
 - User-Agent: Shopify CLI; v=3.48.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

2023-08-08T13:13:39.271Z: Sending POST request to URL https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=ee139b3d-5861-4d45-b387-1bc3ada7811c&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fshop.storefront-renderer.devtools&subject_token=atkn_4ca824b0aac840a5cc5c07ce0b259c4e3f98b202da32bfbfcaf39933d875ddee
With request headers:
 - User-Agent: Shopify CLI; v=3.48.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

2023-08-08T13:13:39.271Z: Sending POST request to URL https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=32ff8ee5-82b8-4d93-9f8a-c6997cefb7dc&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fdestinations.readonly&subject_token=atkn_4ca824b0aac840a5cc5c07ce0b259c4e3f98b202da32bfbfcaf39933d875ddee
With request headers:
 - User-Agent: Shopify CLI; v=3.48.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

2023-08-08T13:13:39.418Z: Request to https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=271e16d403dfa18082ffb3d197bd2b5f4479c3fc32736d69296829cbb28d41a6&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fpartners.app.cli.access&subject_token=atkn_4ca824b0aac840a5cc5c07ce0b259c4e3f98b202da32bfbfcaf39933d875ddee completed in 145 ms
With response headers:
 - cache-control: no-cache, no-store, private, must-revalidate, max-age=0
 - content-type: application/json; charset=utf-8
 - etag: W/"2d7e38ee5a73e8c34fda2f4b1b04cd25"
 - x-request-id: 7fb26baa-e479-40b0-bf21-3ed880a90b39
    
2023-08-08T13:13:39.620Z: Request to https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=32ff8ee5-82b8-4d93-9f8a-c6997cefb7dc&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fdestinations.readonly&subject_token=atkn_4ca824b0aac840a5cc5c07ce0b259c4e3f98b202da32bfbfcaf39933d875ddee completed in 346 ms
With response headers:
 - cache-control: no-cache, no-store, private, must-revalidate, max-age=0
 - content-type: application/json; charset=utf-8
 - etag: W/"fe1e86eee975bcd1bedaac6b91d4fd66"
 - x-request-id: 73f1ddb1-057b-45b6-8bee-9cc3f0860237
    
2023-08-08T13:13:39.676Z: Request to https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=ee139b3d-5861-4d45-b387-1bc3ada7811c&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fshop.storefront-renderer.devtools&subject_token=atkn_4ca824b0aac840a5cc5c07ce0b259c4e3f98b202da32bfbfcaf39933d875ddee completed in 403 ms
With response headers:
 - cache-control: no-cache, no-store, private, must-revalidate, max-age=0
 - content-type: application/json; charset=utf-8
 - etag: W/"0c25872c3cdeeabe397de0c69a08ef52"
 - x-request-id: ca762d33-e908-4dfd-a561-8151599080a0
    
2023-08-08T13:13:39.678Z: Setting session store...
2023-08-08T13:13:39.703Z: Verifying that the user has a Partner organization
2023-08-08T13:13:39.704Z: Sending "Partners" GraphQL request:
  {
    organizations(first: 1) {
      nodes {
        id
      }
    }
  }

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

2023-08-08T13:13:39.965Z: Request to https://partners.shopify.com/api/cli/graphql completed in 229 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"63b4ae126703e8e31ae4434e479b3e02"
 - x-request-id: c14c8fa0-4c44-4a5c-a2f2-6da436cd5d0c
    
2023-08-08T13:13:39.967Z: Sending "Partners" GraphQL request:
  query FindApp($apiKey: String!) {
    app(apiKey: $apiKey) {
      id
      title
      apiKey
      organizationId
      apiSecretKeys {
        secret
      }
      appType
      grantedScopes
      betas {
        unifiedAppDeployment
        unifiedAppDeploymentOptIn
      }
      applicationUrl
      redirectUrlWhitelist
      requestedAccessScopes
      webhookApiVersion
      embedded
      posEmbedded
      preferencesUrl
      gdprWebhooks {
        customerDeletionUrl
        customerDataRequestUrl
        shopDeletionUrl
      }
      appProxy {
        subPath
        subPathPrefix
        url
      }
    }
  }

With variables:
{
  "apiKey": "8277d5bea1264dc146e47dadd6bc1831"
}

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

2023-08-08T13:13:40.870Z: Request to https://partners.shopify.com/api/cli/graphql completed in 901 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"b8e7d4ca4c7533f0bd693d19dc36fae2"
 - x-request-id: 102b351b-e2c5-41fe-9843-b0b147e0a6c5
    
2023-08-08T13:13:40.871Z: Sending "Partners" GraphQL request:
  query FindOrganization($id: ID!) {
    organizations(id: $id, first: 1) {
      nodes {
        id
        businessName
        website
      }
    }
  }

With variables:
{
  "id": "2350588"
}

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

2023-08-08T13:13:41.013Z: Request to https://partners.shopify.com/api/cli/graphql completed in 141 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"2c57500c9f6be586c710dc24e315577b"
 - x-request-id: 78028567-bd92-4677-9321-e887b89f3174
    
╭─ info ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                 │
│  Using these settings:                                                                                                          │
│                                                                                                                                 │
│    • Org:          Spartan Camera                                                                                               │
│    • App:          shipping-rates                                                                                               │
│                                                                                                                                 │
│   You can pass `--reset` to your command to reset your app configuration.                                                       │
│                                                                                                                                 │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

╭─ warning ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                 │
│  `npm run deploy` now releases changes to users.                                                                                │
│                                                                                                                                 │
│  All your extensions will be released to users, unless you add the `--no-release` flag.                                         │
│                                                                                                                                 │
│  Reference                                                                                                                      │
│    • Simplified extension deployment [1]                                                                                        │
│                                                                                                                                 │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
[1] https://shopify.dev/docs/apps/deployment/simplified-deployment

2023-08-08T13:13:41.064Z: Sending "Partners" GraphQL request:
  query allAppExtensionRegistrations($apiKey: String!) {
    app(apiKey: $apiKey) {
      extensionRegistrations {
        id
        uuid
        title
        type
        draftVersion {
          config
        }
        activeVersion {
          config
        }
      }
      dashboardManagedExtensionRegistrations {
        id
        uuid
        title
        type
        activeVersion {
          config
        }
        draftVersion {
          config
        }
      }
      functions {
        id
        uuid
        title
        type: apiType
      }
    }
  }

With variables:
{
  "apiKey": "8277d5bea1264dc146e47dadd6bc1831"
}

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

2023-08-08T13:13:42.275Z: Request to https://partners.shopify.com/api/cli/graphql completed in 1209 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"50a5ef71c9e3b3127d2ede96bda2ae67"
 - x-request-id: 0143aaad-be15-454a-8adb-e9097e37bc89
    
2023-08-08T13:13:42.386Z: Sending "Partners" GraphQL request:
  query activeAppVersion($apiKey: String!) {
    app(apiKey: $apiKey) {
      activeAppVersion {
        appModuleVersions {
          registrationId
          registrationUuid
          registrationTitle
          type
          specification {
            identifier
            name
            options {
              managementExperience
            }
          }
        }
      }
    }
  }

With variables:
{
  "apiKey": "8277d5bea1264dc146e47dadd6bc1831"
}

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

2023-08-08T13:13:42.970Z: Request to https://partners.shopify.com/api/cli/graphql completed in 583 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"d5ea70ae5a5479d76b7523f6ab1ad796"
 - x-request-id: 78a169eb-08c3-476b-aa87-02380a21ad6d
    
?  Release a new version of shipping-rates?
✔  Yes, release this new version


Releasing a new app version as part of shipping-rates

2023-08-08T13:13:46.192Z: Sync-creating directory at /private/var/folders/gw/05yjphkn1_g8sx87_qbn3lxw0000gp/T/04ad36db73b414ee755563cfd6b90a8b/bundle...
2023-08-08T13:13:46.193Z: Creating an empty file at /private/var/folders/gw/05yjphkn1_g8sx87_qbn3lxw0000gp/T/04ad36db73b414ee755563cfd6b90a8b/bundle/.shopify...
2023-08-08T13:13:46.204Z: 
Running system process:
  · Command: npm exec -- graphql-code-generator --config package.json
  · Working directory: /Users/Mao/Development/Shopify-function-app/apps/extensions/shipping-rate

shipping-rate │ Building function shipping-rate...
shipping-rate │ Building GraphQL types...
shipping-rate │ (node:48092) Warning: Label '@graphql-tools/load: collectSources' already exists for console.time()
shipping-rate │ (Use `node --trace-warnings ...` to show where the warning was created)
shipping-rate │ Bundling JS function...
shipping-rate │ Running javy...
2023-08-08T13:13:48.490Z: 
Running system process:
  · Command: npm exec -- javy compile -d -o /Users/Mao/Development/Shopify-function-app/apps/extensions/shipping-rate/dist/function.wasm dist/function.js
  · Working directory: /Users/Mao/Development/Shopify-function-app/apps/extensions/shipping-rate


── external error ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Error coming from `npm exec -- javy compile -d -o /Users/Mao/Development/Shopify-function-app/apps/extensions/shipping-rate/dist/function.wasm dist/function.js`

Command failed with exit code 1: npm exec -- javy compile -d -o /Users/Mao/Development/Shopify-function-app/apps/extensions/shipping-rate/dist/function.wasm dist/function.js

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

2023-08-08T13:13:49.192Z: Obtaining the dependency manager in directory /Users/Mao/Development/Shopify-function-app/apps...
2023-08-08T13:13:49.195Z: 
Running system process:
  · Command: ruby -v
  · Working directory: /Users/Mao/Development/Shopify-function-app/apps

2023-08-08T13:13:49.198Z: Obtaining the dependency manager in directory /Users/Mao/Development/Shopify-function-app/apps...
2023-08-08T13:13:49.199Z: 
Running system process:
  · Command: ruby -v
  · Working directory: /Users/Mao/Development/Shopify-function-app/apps

2023-08-08T13:13:49.471Z: Request to https://monorail-edge.shopifysvc.com/v1/produce completed in 83 ms
With response headers:
 - x-request-id: 45991192-cdcd-4044-a2d6-5e18955373e6
    
2023-08-08T13:13:49.472Z: Analytics event sent: {
  "command": "app deploy",
  "time_start": 1691500418348,
  "time_end": 1691500429196,
  "total_time": 10848,
  "success": true,
  "cli_version": "3.48.0",
  "ruby_version": "3.2.2",
  "node_version": "20.4.0",
  "is_employee": false,
  "uname": "darwin amd64",
  "env_ci": false,
  "env_plugin_installed_any_custom": false,
  "env_plugin_installed_shopify": "[\"@shopify/app\",\"@shopify/cli\",\"@shopify/plugin-cloudflare\",\"@shopify/plugin-did-you-mean\"]",
  "env_shell": "zsh",
  "env_device_id": "b60ad036ef6f9154586434bea24b5784419f46fe",
  "env_cloud": "localhost",
  "env_package_manager": "npm",
  "cmd_app_warning_api_key_deprecation_displayed": false,
  "cmd_deploy_flag_message_used": false,
  "cmd_deploy_flag_version_used": false,
  "cmd_deploy_flag_source_url_used": false,
  "project_type": "node",
  "app_extensions_any": true,
  "app_extensions_breakdown": "{\"delivery_customization\":1}",
  "app_extensions_count": 1,
  "app_extensions_custom_layout": false,
  "app_extensions_function_any": true,
  "app_extensions_function_count": 1,
  "app_extensions_theme_any": false,
  "app_extensions_theme_count": 0,
  "app_extensions_ui_any": false,
  "app_extensions_ui_count": 0,
  "app_name_hash": "8025087a9e2e8d0e95e2da2152e8be2f55276616",
  "app_path_hash": "1cc3966cf44bbd3e09f8a0f2b30fbd43baad730e",
  "app_scopes": "[\"write_products\"]",
  "app_web_backend_any": true,
  "app_web_backend_count": 1,
  "app_web_custom_layout": false,
  "app_web_framework": "unknown",
  "app_web_frontend_any": false,
  "app_web_frontend_count": 0,
  "env_package_manager_workspaces": true,
  "cmd_app_all_configs_any": false,
  "cmd_app_all_configs_clients": "{}",
  "cmd_app_linked_config_used": false,
  "cmd_app_deployment_mode": "unified",
  "cmd_deploy_confirm_new_registrations": 1,
  "cmd_deploy_confirm_updated_registrations": 0,
  "cmd_deploy_confirm_removed_registrations": 0,
  "cmd_deploy_confirm_cancelled": false,
  "cmd_deploy_confirm_time_to_complete_ms": 1691500422970,
  "partner_id": 2350588,
  "api_key": "8277d5bea1264dc146e47dadd6bc1831",
  "cmd_all_launcher": "npm",
  "cmd_all_topic": "app",
  "cmd_all_plugin": "@shopify/app",
  "cmd_all_verbose": true,
  "cmd_all_path_override": true,
  "cmd_all_path_override_hash": "1cc3966cf44bbd3e09f8a0f2b30fbd43baad730e",
  "cmd_app_reset_used": false,
  "args": "--verbose",
  "app_name": "apps",
  "env_plugin_installed_all": "[\"@shopify/app\",\"@shopify/cli\",\"@shopify/plugin-cloudflare\",\"@shopify/plugin-did-you-mean\"]",
  "metadata": "{\"extraPublic\":{},\"extraSensitive\":{}}"
}
2023-08-08T13:13:49.475Z: Completed command app deploy
2023-08-08T13:13:49.477Z: Request to https://monorail-edge.shopifysvc.com/v1/produce completed in 91 ms
With response headers:
 - x-request-id: dd29cc7f-997c-4763-bc3f-3b63e9ab2ff2
    
2023-08-08T13:13:49.477Z: Analytics event sent: {
  "command": "app deploy",
  "time_start": 1691500418348,
  "time_end": 1691500429184,
  "total_time": 10836,
  "success": false,
  "cli_version": "3.48.0",
  "ruby_version": "3.2.2",
  "node_version": "20.4.0",
  "is_employee": false,
  "uname": "darwin amd64",
  "env_ci": false,
  "env_plugin_installed_any_custom": false,
  "env_plugin_installed_shopify": "[\"@shopify/app\",\"@shopify/cli\",\"@shopify/plugin-cloudflare\",\"@shopify/plugin-did-you-mean\"]",
  "env_shell": "zsh",
  "env_device_id": "b60ad036ef6f9154586434bea24b5784419f46fe",
  "env_cloud": "localhost",
  "env_package_manager": "npm",
  "cmd_app_warning_api_key_deprecation_displayed": false,
  "cmd_deploy_flag_message_used": false,
  "cmd_deploy_flag_version_used": false,
  "cmd_deploy_flag_source_url_used": false,
  "project_type": "node",
  "app_extensions_any": true,
  "app_extensions_breakdown": "{\"delivery_customization\":1}",
  "app_extensions_count": 1,
  "app_extensions_custom_layout": false,
  "app_extensions_function_any": true,
  "app_extensions_function_count": 1,
  "app_extensions_theme_any": false,
  "app_extensions_theme_count": 0,
  "app_extensions_ui_any": false,
  "app_extensions_ui_count": 0,
  "app_name_hash": "8025087a9e2e8d0e95e2da2152e8be2f55276616",
  "app_path_hash": "1cc3966cf44bbd3e09f8a0f2b30fbd43baad730e",
  "app_scopes": "[\"write_products\"]",
  "app_web_backend_any": true,
  "app_web_backend_count": 1,
  "app_web_custom_layout": false,
  "app_web_framework": "unknown",
  "app_web_frontend_any": false,
  "app_web_frontend_count": 0,
  "env_package_manager_workspaces": true,
  "cmd_app_all_configs_any": false,
  "cmd_app_all_configs_clients": "{}",
  "cmd_app_linked_config_used": false,
  "cmd_app_deployment_mode": "unified",
  "cmd_deploy_confirm_new_registrations": 1,
  "cmd_deploy_confirm_updated_registrations": 0,
  "cmd_deploy_confirm_removed_registrations": 0,
  "cmd_deploy_confirm_cancelled": false,
  "cmd_deploy_confirm_time_to_complete_ms": 1691500422970,
  "partner_id": 2350588,
  "api_key": "8277d5bea1264dc146e47dadd6bc1831",
  "cmd_all_launcher": "npm",
  "cmd_all_topic": "app",
  "cmd_all_plugin": "@shopify/app",
  "cmd_all_verbose": true,
  "cmd_all_path_override": true,
  "cmd_all_path_override_hash": "1cc3966cf44bbd3e09f8a0f2b30fbd43baad730e",
  "cmd_app_reset_used": false,
  "args": "--verbose",
  "error_message": "Command failed with exit code 1: npm exec -- javy compile -d -o /Users/Mao/Development/Shopify-function-app/apps/extensions/shipping-rate/dist/function.wasm dist/function.js",
  "app_name": "apps",
  "env_plugin_installed_all": "[\"@shopify/app\",\"@shopify/cli\",\"@shopify/plugin-cloudflare\",\"@shopify/plugin-did-you-mean\"]",
  "metadata": "{\"extraPublic\":{},\"extraSensitive\":{}}"
}

Reproduction steps

  1. npm run deploy -- --verbose

Operating System

MacOS ventura 13.0.1

Shopify CLI version (check your project's package.json if you're not sure)

3.48.0

Shell

No response

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

v20.4.0

What language and version are you using in your application?

No response

@hailong111 hailong111 added the Type: Bug Something isn't working label Aug 8, 2023
@hailong111 hailong111 changed the title [Bug]: stuck with running npm run deploy. [Bug]: issue with running npm run deploy. Aug 8, 2023
@gonzaloriestra
Copy link
Contributor

Hi! I'm not able to reproduce it. I guess you just have an app with a Delivery Customization function in JS, right?

Could you please go to your extension folder and run these commands?

  • npm exec -- javy --version
  • npm exec -- javy compile -d -o dist/function.wasm dist/function.js

Does it work if you create a new app with a new extension?

@hailong111
Copy link
Author

Hi! I'm not able to reproduce it. I guess you just have an app with a Delivery Customization function in JS, right?

Could you please go to your extension folder and run these commands?

  • npm exec -- javy --version
  • npm exec -- javy compile -d -o dist/function.wasm dist/function.js
yes, I run both of them, but no any response. 

Does it work if you create a new app with a new extension?

no, it will have the same issue.

@gonzaloriestra
Copy link
Contributor

That's weird. Could you try this?

  • rm ~/Library/Caches/binarycache/javy*
  • rm -r node_modules
  • npm install
  • npm exec -- javy --version

If it keeps failing, then could you share the outputs of these commands?

  • ls -lah node_modules/.bin/javy
  • ls -lah node_modules/javy-cli/index.js
  • FORCE_FROM_SOURCE=1 npm exec -- javy --version

@mdenoronha
Copy link

mdenoronha commented Aug 11, 2023

Following on from the above. Experiencing the same issue on just running npm run dev on Remix template. Steps didn't work, output from those commands below

  • lrwxr-xr-x@ 1 matthew staff 20B Aug 11 14:50 node_modules/.bin/javy -> ../javy-cli/index.js
  • -rwxr-xr-x@ 1 matthew staff 5.0K Aug 11 14:50 node_modules/javy-cli/index.js
  • Nothing

@mahdi-akbary
Copy link

mahdi-akbary commented Aug 13, 2023

Thanks to @gonzaloriestra the problem was solved, I think it's related to different versions of javy being installed, I just removed what you have mentioned above. and in my case, I also had to remove Yarn and use npm for it to deploy.

I think it's safe to close this issue.

@mdenoronha
Copy link

mdenoronha commented Aug 13, 2023

Issue still occurring for me, possibly @hailong111 too?
For me, using product-discount template. Using javy versions 0.1.1 and 0.1.2.
On deploying getting
Command failed with exit code 1: npm exec -- javy compile -d -o /Users/matthew/Documents/WCW/wcw-function/wcw-functions/extensions/product-discount/dist/function.wasm dist/function.js error.

@gonzaloriestra
Copy link
Contributor

@jeffcharles @saulecabrera @surma javy is apparently doing nothing here. Any clue? Is there a way to show verbose outputs or check the logs? Thanks!

@surma
Copy link
Member

surma commented Aug 14, 2023

This is puzzling me! This really shouldn’t be happening, but I can’t reproduce it either locally, so I’ll follow a hunch and take a stab in the dark. Sorry to give you the runaround @mdenoronha!

Can you do me a favor and run rm -rf ~/.javy_cache, and then try again?

@mdenoronha
Copy link

Happy to keep trying, got a Plus store here keen to get it working.
Tried and same issue I'm afraid. Happens as soon as it tries running javy

@jeffcharles
Copy link
Contributor

One thing that is unexpected for me is that there's an npm exec call invoking the javy NPM package. I would have expected one of the following:

  • an npm exec -- javy-cli compile [...] call
  • an npm exec -c 'javy compile [...]' call
  • for javy to be invoked directly inside an NPM script without the use of npm exec

I'm not 100% sure what the behaviour of npm exec -- is when invoking the name of a bin exposed by an NPM package installed in an NPM project but not installed globally.

For context, the javy NPM package is a library for higher-level I/O helpers for writing code in Javy. It's not an executable package. The javy-cli NPM package is an executable and is what downloads and executes a cached javy binary. And as far as I understand, the argument after the double-dash in an npm exec invocation should be the name of the NPM package to execute. At least if I'm interpreting npm exec --help's output correctly, npm exec -- <pkg>[@<version>] [args...]. That said, if the javy-cli package is globally installed, then npm exec -- javy compile [...] will work as well. But we shouldn't require the javy-cli package to be globally installed.

To add some extra confusion, version 0.0.1 and 0.0.2 of the javy NPM package was the javy-cli NPM package prior to introduction of the javy-cli NPM package, and I don't think npm exec will fetch the latest version of an NPM package if an existing version has been downloaded or installed before. So it may be the case that npm exec -- javy compile [...] will work for users who first ran that command prior to the publishing of 0.0.3 (January 11, 2023) and will not work for other users.

I suspect that whatever is specifying npm exec -- javy compile [...] as the command to run may need to be changed.

@mdenoronha
Copy link

mdenoronha commented Aug 15, 2023

Had a look, I believe the npm exec call was written wrong. Fix added to 2649. It's working for me now. @jeffcharles

@jeffcharles
Copy link
Contributor

It's unexpected to me that moving the input path argument to right after compile instead of at the end of the command would fix your issue. Either position is valid for the input argument.

All four of:

➜  javy git:(main) target/release/javy compile index.js -d -o index.wasm
➜  javy git:(main) target/release/javy compile -d -o index.wasm index.js
➜  javy git:(main) npm exec -- javy-cli@latest compile index.js -d -o index.wasm
➜  javy git:(main) npm exec -- javy-cli@latest compile -d -o index.wasm index.js

work for me.

That said, it's interesting that that fixed your issue. I'd like to understand why it did.

Can you clarify by what you meant in #2626 (comment) with:

Using javy versions 0.1.1 and 0.1.2.

Is the javy you're referring to in this context, the javy NPM package, the javy-cli NPM package, the javy binary, or the version of something else?

The reason I ask is I suspect this is referring to the javy NPM package which is not used for running Javy and the version of the javy-cli NPM package is what would be helpful for diagnosing the issue.

@mdenoronha
Copy link

mdenoronha commented Aug 15, 2023

@mahdi-akbary comment mentioned about Javy versions, so tried javy NPM package 0.1.2 in the extension but didn't make a difference.

My mistake, I installed javy globally to use as such:

    const args = ['compile', 'dist/function.js','-d', '-o', fun.outputPath, ...extra]
    return exec('javy', args, {
        cwd: fun.directory,
        stdout: 'inherit',
        stderr: 'inherit',
        signal: options.signal,
    });

It worked, but then assumed the order of directories was the issue, so updated args to be ['exec', '--', 'javy', 'compile', 'dist/function.js', '-d', '-o', fun.outputPath, ...extra] with npm and continued to work. May have just been the global javy wasn't uninstalled properly though.

It's actually uninstalled now and it's not working.

Although, I've just installed globally again and still not working so not too sure here.

@mdenoronha
Copy link

Yeah, It was just javy was still installed globally, just needed Node version 20.5.0 (didn't work when using 18.12.0).

Not overly helpful, but I guess I'd mention as a workaround for anyone else with this issue until this is addressed .

@jeffcharles
Copy link
Contributor

It was just javy was still installed globally

If the javy-cli NPM package were installed globally, that would make sense. But we shouldn't be requiring that. The javy NPM package being installed globally shouldn't make a difference. javy-cli is what adds an executable Node file named javy on the PATH.

just needed Node version 20.5.0 (didn't work when using 18.12.0)

This is interesting. I'll take a look at the impact of using different Node versions. Thanks!

@jeffcharles
Copy link
Contributor

I ran:

npm exec -- javy-cli@latest compile -d -o index.wasm index.js
npm exec -- javy-cli@latest compile index.js -d -o index.wasm
npm install -g javy-cli
npm exec -- javy compile -d -o index.wasm index.js
npm exec -- javy compile index.js -d -o index.wasm

with Node 18.12.0 and all four invocations worked.

@mdenoronha
Copy link

mdenoronha commented Aug 15, 2023

Oh yeah, can ignore that Node version point, javy-cli must have still been installed globally (possibly even with javy not installed). All those commands and npm run deploy work or don't work based on if it's installed globally.

The store it's being implemented for obviously don't mind this workaround. I guess it just waiting on that alternative fix to be implemented on the runJavy call in @ shopify package.

@jeffcharles
Copy link
Contributor

Okay, that aligns with my understanding. I think the fix is changing that npm exec -- javy compile [...] call to either npm exec -c 'javy compile [...]' (assuming the javy-cli NPM package is installed in the NPM project, won't work if it's not) or npm exec -- javy-cli compile [...] (may want to use javy-cli@latest if the javy-cli NPM package is not installed in the project).

@gonzaloriestra
Copy link
Contributor

@jeffcharles thanks a lot for your help!

Before preparing a fix, @mdenoronha could you please uninstall the global javy and try this from the app root?

  • sed -i '' "s/'javy'/'javy-cli'/g" node_modules/@shopify/app/dist/cli/services/function/build.js
  • npm run deploy

@mdenoronha
Copy link

Same response, just exit code is now 127.

@gonzaloriestra
Copy link
Contributor

Hmm, could you run these ones?

  • npm exec -- javy-cli --version
  • npm exec -- javy-cli compile -d -o dist/function.wasm dist/function.js
  • npm -v

@mdenoronha
Copy link

Both sh: javy: command not found
NPM version 8.19.2

@jeffcharles
Copy link
Contributor

What's the output of:

  • npm list javy-cli
  • npm cache ls javy-cli
  • node --version

What's your operating system? Are you also using MacOS Ventura?

If you're on a Mac, can you run:

  • ll ~/Library/Caches/binarycache/

If you're using Linux, can you run:

  • ll ~/.cache/binarycache/

If you're using Windows, can you run:

  • dir %HOME%\AppData\Local\binarycache\

@mdenoronha
Copy link

wcw-functions@ /Users/matthew/Documents/WCW/wcw-function/wcw-functions └─┬ @shopify/app@3.48.1 └── javy-cli@0.1.7

make-fetch-happen:request-cache:https://registry.npmjs.org/javy-cli make-fetch-happen:request-cache:https://registry.npmjs.org/javy-cli/-/javy-cli-0.1.4.tgz make-fetch-happen:request-cache:https://registry.npmjs.org/javy-cli/-/javy-cli-0.1.7.tgz make-fetch-happen:request-cache:https://registry.npmjs.org/javy-cli/-/javy-cli-0.1.8.tgz

Node v18.12.0

Mac Ventura 13.2.1

Getting command not found for the ll commands

@jeffcharles
Copy link
Contributor

Okay. I would advise updating the project's javy-cli from 0.1.7 to 0.1.8. There was a bugfix introduced in 0.1.8 to deal with empty javy binaries being created when there was a non-200 status code returned when downloading the binaries. Then you may want to retry the suggestion in #2626 (comment).

Can you run ls -lh ~/Library/Caches/binarycache/?

@mdenoronha
Copy link

javy-cli 0.1.8 appears to work and compile successfully. Output from npm list javy-cli was:

wcw-functions@ /Users/matthew/Documents/WCW/wcw-function/wcw-functions
├─┬ @shopify/app@3.48.1
│ └── javy-cli@0.1.7
└── javy-cli@0.1.8

ls -lh ~/Library/Caches/binarycache/ output was:

total 107640
-rwxrwxr-x@ 1 matthew  staff    13M Aug 15 12:06 function-runner-v3.6.0
-rwxrwxr-x@ 1 matthew  staff    39M Aug 15 13:00 javy-v1.1.2

@jeffcharles
Copy link
Contributor

Glad to hear that worked! Sounds like the javy-cli dependency needs to be updated in shopify/app (and possibly elsewhere?) to the latest version if it hasn't been already.

I looked into it and it looks like npm exec -- javy [...] does work if the javy-cli package is installed in the NPM project where that npm exec call is made. So the npm exec call shouldn't need to be changed.

@gonzaloriestra
Copy link
Contributor

I see it has been already updated here and included in v3.48.1. So I guess a simple CLI upgrade would have been enough here... 😅

So I'm closing, since everything looks good now. Thank you everyone for the feedback and help.

@Vijendra2016
Copy link

Hi this issue again arrive , i am having the same issue when i try to run my app .

Error coming from npm exec -- javy --version

Command failed with exit code 1: npm exec -- javy --version

@Vijendra2016
Copy link

Please help me this , i have urgent update on my app .

@gonzaloriestra
Copy link
Contributor

@Vijendra2016 Do you have the latest CLI version? Otherwise, could you try some of the things above to try to find out what's going on? I'd start with this: #2626 (comment)

@Vijendra2016
Copy link

@gonzaloriestra i have latest version of cli.

@Vijendra2016
Copy link

i even installed the node and reinstalled latest version of node but i still facing same issue.

@Vijendra2016
Copy link

Error coming from npm exec -- javy --version
Command failed with exit code 1: npm exec -- javy --version

I follow same steps you mension previously but it not work. same error i facing

@gonzaloriestra
Copy link
Contributor

Could you please follow the conversation here and post the outputs of the several suggested commands?

@Vijendra2016
Copy link

I follow all i still get same error , can anyone give me way to fix this .

@Vijendra2016
Copy link

vjnnewstuff

@gonzaloriestra
Copy link
Contributor

In order to investigate, we need more information, like:

  • Reproduction steps
  • Used extensions
  • Versions: CLI, Node, package manager, OS...
  • Outputs from the suggested commands above

@Vijendra2016
Copy link

Reproduction steps - When i create new app
Used extensions - Payment customization - Function
Versions: CLI, Node, package manager, OS...
npm: '10.4.0',
node: '21.6.1',
Shopify CLI version: 3.55.2
Window 11

Outputs from the suggested commands above
── external error ──────────────────────────────────────────────────────────────

Error coming from npm exec -- javy --version

Command failed with exit code 1: npm exec -- javy --version

────────────────────────────────────────────────────────────────────────────────

@Vijendra2016
Copy link

When i run my app npm run dev or pnpm dev
its show the previews the store but suddenly the server is down with this error
── external error ──────────────────────────────────────────────────────────────

Error coming from npm exec -- javy --version

Command failed with exit code 1: npm exec -- javy --version

@Vijendra2016
Copy link

more information
clinewhidevjn

@Vijendra2016
Copy link

this error i conunter last week , everthing was working fine before

@Vijendra2016
Copy link

This Issure is resolve i delete all javy files in r %HOME%\AppData\Local\binarycache\

@gonzaloriestra
Copy link
Contributor

Great, so it was solved by my first suggestion.

@Vijendra2016
Copy link

Yes your first suggestion was worked .
I delete the Javy files in binarycache .
cachenew

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
7 participants