Shopify / cli

Build apps, themes, and hydrogen storefronts for Shopify
https://shopify.dev
MIT License
424 stars 126 forks source link

[Bug]: Shopify App Build Is Failing #4586

Open etaylork opened 2 weeks ago

etaylork commented 2 weeks ago

Please confirm that you have:

In which of these areas are you experiencing a problem?

App

Expected behavior

app installs dependencies when running

  1. shopify app build

I am receiving the following error

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

Error coming from `yarn install`

Command failed with exit code 1: yarn install
husky - .git can't be found (see https://typicode.github.io/husky/#/?id=custom-directory)
error Command failed with exit code 1.
yarn install v1.22.19
[1/4] Resolving packages...
success Already up-to-date.
$ husky install
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

@shopify/cli/3.68.0

npm v20.10.0

Actual behavior

Expected for dependencies to download and dev environment to start up for shopify app

Verbose output


2024-10-07T07:07:03.328Z: 
Running system process:
  · Command: npm prefix
  · Working directory: /Users/elijah.taylor-kuni/gadget/gatcha

2024-10-07T07:07:03.834Z: Obtaining the dependency manager in directory /Users/elijah.taylor-kuni/gadget/gatcha...
2024-10-07T07:07:03.839Z: 
Running system process:
  · Command: /usr/local/opt/ruby/bin/ruby -v
  · Working directory: /Users/elijah.taylor-kuni/gadget/gatcha

2024-10-07T07:07:04.220Z: Request to https://monorail-edge.shopifysvc.com/v1/produce completed in 321 ms
With response headers:
 - x-request-id: 6cf1f9f8-8a2c-4a98-9c35-ce5f9a39bc12

2024-10-07T07:07:04.220Z: Analytics event sent: {
  "command": "app dev",
  "time_start": 1728284816570,
  "time_end": 1728284823319,
  "total_time": 6749,
  "success": false,
  "cli_version": "3.68.0",
  "ruby_version": "3.3.5",
  "node_version": "22.9.0",
  "is_employee": false,
  "uname": "darwin amd64",
  "env_ci": false,
  "env_plugin_installed_any_custom": false,
  "env_plugin_installed_shopify": "[\"@shopify/cli\"]",
  "env_shell": "zsh",
  "env_device_id": "b179476358f8228be2442eaafaef8adbfe7e331d",
  "env_cloud": "localhost",
  "env_package_manager": "yarn",
  "env_is_global": true,
  "env_auth_method": "device_auth",
  "cmd_app_warning_api_key_deprecation_displayed": false,
  "cmd_app_all_configs_any": true,
  "cmd_app_all_configs_clients": "{\"shopify.app.toml\":\"9a505f9be3b83c61993759c7900fe449\"}",
  "cmd_app_linked_config_used": true,
  "cmd_app_linked_config_name": "shopify.app.toml",
  "cmd_app_linked_config_git_tracked": true,
  "cmd_app_linked_config_source": "cached",
  "partner_id": 3770395,
  "api_key": "****",
  "app_extensions_any": true,
  "app_extensions_breakdown": "{\"theme\":1}",
  "app_extensions_count": 1,
  "app_extensions_custom_layout": false,
  "app_extensions_function_any": false,
  "app_extensions_function_count": 0,
  "app_extensions_theme_any": true,
  "app_extensions_theme_count": 1,
  "app_extensions_ui_any": false,
  "app_extensions_ui_count": 0,
  "app_name_hash": "683f5cc8f8205cdbb1fd5f9ee9ec34b1124e02db",
  "app_path_hash": "e018685065a52089cd6d30818691be79d14a1ac4",
  "app_scopes": "[]",
  "app_web_backend_any": false,
  "app_web_backend_count": 0,
  "app_web_custom_layout": false,
  "app_web_frontend_any": false,
  "app_web_frontend_count": 0,
  "env_package_manager_workspaces": false,
  "cmd_all_timing_network_ms": 4860,
  "cmd_all_timing_prompts_ms": 0,
  "cmd_all_launcher": "unknown",
  "cmd_all_topic": "app",
  "cmd_all_plugin": "@shopify/app",
  "cmd_all_verbose": true,
  "cmd_all_path_override": true,
  "cmd_all_path_override_hash": "e018685065a52089cd6d30818691be79d14a1ac4",
  "cmd_app_dependency_installation_skipped": false,
  "cmd_app_reset_used": false,
  "cmd_dev_tunnel_type": "cloudflare",
  "cmd_all_timing_active_ms": 1888,
  "cmd_all_exit": "expected_error",
  "user_id": "3e01b724-e128-4497-8762-64b4517bac1c",
  "args": "--verbose",
  "error_message": "Command failed with exit code 1: yarn install\nhusky - .git can't be found (see https://typicode.github.io/husky/#/?id=custom-directory)\n\u001b[2K\u001b[1G\u001b[31merror\u001b[39m Command failed with exit code 1.\n\u001b[2K\u001b[1G\u001b[1myarn install v1.22.19\u001b[22m\n\u001b[2K\u001b[1G\u001b[2m[1/4]\u001b[22m Resolving packages...\n\u001b[2K\u001b[1G\u001b[32msuccess\u001b[39m Already up-to-date.\n\u001b[2K\u001b[1G\u001b[2m$ husky install\u001b[22m\n\u001b[2K\u001b[1G\u001b[34minfo\u001b[39m Visit \u001b[1mhttps://yarnpkg.com/en/docs/cli/install\u001b[22m for documentation about this command.",
  "app_name": "gatcha",
  "env_plugin_installed_all": "[\"@shopify/cli\"]",
  "metadata": "{\"extraPublic\":{},\"extraSensitive\":{}}"
}

Reproduction steps

  1. cd into shopify app root repo
  2. execute shopify app dev

Operating System

Mac OS

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

@shopify/cli/3.68.0

Shell

zsh

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

v20.10.0

What language and version are you using in your application?

Typescript

isaacroldan commented 6 days ago

Hey @etaylork, is this an old app? I noticed that you are not using workspaces, which were introduced more than 1 year ago for new projects.

When not using workspaces in an app project, the CLI is forced to install dependencies for each extension independently, which in this case is failing by not finding git.

Three possible solutions: