[Bug]: extension_directories is not working
Please confirm that you have:
- [x] 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.)
- [x] Reproduced the issue in the latest CLI version.
In which of these areas are you experiencing a problem?
Extension
Expected behavior
This functionality is not working, which is making deployment difficult. Since updating to the latest version, 3.77.1, I can no longer deploy.
shopify.app.toml:
extension_directories = ["extensions/*", "extensions/prod/*"
directory:
extensions/
dev/
prod/
staging/
error:
╭─ error ──────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Duplicated handle "discount-add-customer" in extensions "ディスカウントに利用可能な顧客を追加する", │
│ "ディスカウントに利用可能な顧客を追加する" and "ディスカウントに利用可能な顧客を追加する". Handle needs to │
│ be unique per extension. │
│ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Similar issues
http://github.com/Shopify/cli/issues/4702
Actual behavior
The deployment is successful
Verbose output
Verbose output
With response headers:
- cache-control: max-age=0, private, must-revalidate
- content-type: application/json; charset=utf-8
- etag: W/"afc3b9b0074d419c8d1196f8df0f75f4"
- server-timing: processing;dur=80, socket_queue;dur=6.685, util;dur=1.0, cfRequestDuration;dur=293.999910
- x-request-id: 22ff5acc-e787-4283-ad02-19a968655c43-1744119341
2025-04-08T13:35:42.028Z: The following extension specifications were defined locally but not found in the remote specifications: payments_extension, tax_calculation
2025-04-08T13:35:42.032Z: Reading the content of file at shopify.app.erp-dev-remote.toml...
2025-04-08T13:35:42.032Z: Reading the content of file at shopify.app.erp-e2e-a1-remote.toml...
2025-04-08T13:35:42.032Z: Reading the content of file at shopify.app.erp-stg-remote-tsi.toml...
2025-04-08T13:35:42.032Z: Reading the content of file at shopify.app.erp-stg-remote.toml...
2025-04-08T13:35:42.032Z: Reading the content of file at shopify.app.local-a1.toml...
2025-04-08T13:35:42.032Z: Reading the content of file at shopify.app.local-a2.toml...
2025-04-08T13:35:42.035Z: Reading the content of file at .gitignore...
2025-04-08T13:35:42.041Z: Reading the .env file at .env.sq
2025-04-08T13:35:42.041Z: Reading the content of file at .env.sq...
2025-04-08T13:35:42.051Z: Reading the content of file at extensions/checkout-ui-point-use-form/shopify.extension.toml...
2025-04-08T13:35:42.051Z: Reading the content of file at extensions/birthday-point-earned/shopify.extension.toml...
2025-04-08T13:35:42.051Z: Reading the content of file at extensions/customer-metafield-updated/shopify.extension.toml...
2025-04-08T13:35:42.051Z: Reading the content of file at extensions/customer-point-updated/shopify.extension.toml...
2025-04-08T13:35:42.051Z: Reading the content of file at extensions/customer-rank-down/shopify.extension.toml...
2025-04-08T13:35:42.051Z: Reading the content of file at extensions/customer-rank-up/shopify.extension.toml...
2025-04-08T13:35:42.051Z: Reading the content of file at extensions/customer-tags-changed/shopify.extension.toml...
2025-04-08T13:35:42.051Z: Reading the content of file at extensions/checkout-ui-local-pickup/shopify.extension.toml...
2025-04-08T13:35:42.051Z: Reading the content of file at extensions/function-hide-payment-by-cart-attribute/shopify.extension.toml...
2025-04-08T13:35:42.051Z: Reading the content of file at extensions/function-point-use/shopify.extension.toml...
2025-04-08T13:35:42.051Z: Reading the content of file at extensions/function-product-discount-by-variants/shopify.extension.toml...
2025-04-08T13:35:42.051Z: Reading the content of file at extensions/function-order-discount-local-pickup/shopify.extension.toml...
2025-04-08T13:35:42.051Z: Reading the content of file at extensions/function-shipping-discount-local-pickup/shopify.extension.toml...
2025-04-08T13:35:42.052Z: Reading the content of file at extensions/function-shipping-discount-exclude-tags/shopify.extension.toml...
2025-04-08T13:35:42.052Z: Reading the content of file at extensions/order-metafield-updated/shopify.extension.toml...
2025-04-08T13:35:42.052Z: Reading the content of file at extensions/order-tags-changed/shopify.extension.toml...
2025-04-08T13:35:42.052Z: Reading the content of file at extensions/product-metafield-updated/shopify.extension.toml...
2025-04-08T13:35:42.052Z: Reading the content of file at extensions/function-shipping-discount-by-customer/shopify.extension.toml...
2025-04-08T13:35:42.052Z: Reading the content of file at extensions/product-tags-changed/shopify.extension.toml...
2025-04-08T13:35:42.052Z: Reading the content of file at extensions/point-will-be-expired/shopify.extension.toml...
2025-04-08T13:35:42.052Z: Reading the content of file at extensions/function-product-discount-by-collection/shopify.extension.toml...
2025-04-08T13:35:42.052Z: Reading the content of file at extensions/dev/discount-add-customer/shopify.extension.toml...
2025-04-08T13:35:42.052Z: Reading the content of file at extensions/dev/point-minus-create/shopify.extension.toml...
2025-04-08T13:35:42.052Z: Reading the content of file at extensions/dev/point-plus-create/shopify.extension.toml...
2025-04-08T13:35:42.052Z: Reading the content of file at extensions/staging/discount-add-customer/shopify.extension.toml...
2025-04-08T13:35:42.052Z: Reading the content of file at extensions/staging/point-minus-create/shopify.extension.toml...
2025-04-08T13:35:42.052Z: Reading the content of file at extensions/staging/point-plus-create/shopify.extension.toml...
2025-04-08T13:35:42.052Z: Reading the content of file at extensions/prod/flow-template-product-tags-changed/shopify.extension.toml...
2025-04-08T13:35:42.052Z: Reading the content of file at extensions/prod/flow-template-order-tags-changed/shopify.extension.toml...
2025-04-08T13:35:42.052Z: Reading the content of file at extensions/prod/flow-template-customer-tags-changed/shopify.extension.toml...
2025-04-08T13:35:42.052Z: Reading the content of file at extensions/prod/point-minus-create/shopify.extension.toml...
2025-04-08T13:35:42.052Z: Reading the content of file at extensions/prod/point-plus-create/shopify.extension.toml...
2025-04-08T13:35:42.052Z: Reading the content of file at extensions/prod/discount-add-customer/shopify.extension.toml...
2025-04-08T13:35:42.057Z: Reading the content of file at extensions/customer-point-updated/shopify.extension.toml...
2025-04-08T13:35:42.057Z: Reading the content of file at extensions/customer-metafield-updated/shopify.extension.toml...
2025-04-08T13:35:42.057Z: Reading the content of file at extensions/birthday-point-earned/shopify.extension.toml...
2025-04-08T13:35:42.057Z: Reading the content of file at extensions/customer-rank-down/shopify.extension.toml...
2025-04-08T13:35:42.057Z: Reading the content of file at extensions/customer-rank-up/shopify.extension.toml...
2025-04-08T13:35:42.057Z: Reading the content of file at extensions/customer-tags-changed/shopify.extension.toml...
2025-04-08T13:35:42.057Z: Reading the content of file at extensions/function-point-use/shopify.extension.toml...
2025-04-08T13:35:42.057Z: Reading the content of file at extensions/checkout-ui-point-use-form/shopify.extension.toml...
2025-04-08T13:35:42.057Z: Reading the content of file at extensions/checkout-ui-local-pickup/shopify.extension.toml...
2025-04-08T13:35:42.057Z: Reading the content of file at extensions/function-hide-payment-by-cart-attribute/shopify.extension.toml...
2025-04-08T13:35:42.058Z: Reading the content of file at extensions/function-product-discount-by-variants/shopify.extension.toml...
2025-04-08T13:35:42.058Z: Reading the content of file at extensions/function-order-discount-local-pickup/shopify.extension.toml...
2025-04-08T13:35:42.058Z: Reading the content of file at extensions/function-shipping-discount-local-pickup/shopify.extension.toml...
2025-04-08T13:35:42.058Z: Reading the content of file at extensions/order-metafield-updated/shopify.extension.toml...
2025-04-08T13:35:42.058Z: Reading the content of file at extensions/order-tags-changed/shopify.extension.toml...
2025-04-08T13:35:42.058Z: Reading the content of file at extensions/function-shipping-discount-by-customer/shopify.extension.toml...
2025-04-08T13:35:42.058Z: Reading the content of file at extensions/function-shipping-discount-exclude-tags/shopify.extension.toml...
2025-04-08T13:35:42.058Z: Reading the content of file at extensions/product-metafield-updated/shopify.extension.toml...
2025-04-08T13:35:42.058Z: Reading the content of file at extensions/product-tags-changed/shopify.extension.toml...
2025-04-08T13:35:42.058Z: Reading the content of file at extensions/function-product-discount-by-collection/shopify.extension.toml...
2025-04-08T13:35:42.058Z: Reading the content of file at extensions/dev/point-minus-create/shopify.extension.toml...
2025-04-08T13:35:42.058Z: Reading the content of file at extensions/dev/point-plus-create/shopify.extension.toml...
2025-04-08T13:35:42.058Z: Reading the content of file at extensions/point-will-be-expired/shopify.extension.toml...
2025-04-08T13:35:42.058Z: Reading the content of file at extensions/staging/discount-add-customer/shopify.extension.toml...
2025-04-08T13:35:42.058Z: Reading the content of file at extensions/dev/discount-add-customer/shopify.extension.toml...
2025-04-08T13:35:42.058Z: Reading the content of file at extensions/prod/flow-template-product-tags-changed/shopify.extension.toml...
2025-04-08T13:35:42.058Z: Reading the content of file at extensions/staging/point-minus-create/shopify.extension.toml...
2025-04-08T13:35:42.058Z: Reading the content of file at extensions/staging/point-plus-create/shopify.extension.toml...
2025-04-08T13:35:42.058Z: Reading the content of file at extensions/prod/point-minus-create/shopify.extension.toml...
2025-04-08T13:35:42.058Z: Reading the content of file at extensions/prod/point-plus-create/shopify.extension.toml...
2025-04-08T13:35:42.058Z: Reading the content of file at extensions/prod/discount-add-customer/shopify.extension.toml...
2025-04-08T13:35:42.058Z: Reading the content of file at extensions/prod/flow-template-customer-tags-changed/shopify.extension.toml...
2025-04-08T13:35:42.058Z: Reading the content of file at extensions/prod/flow-template-order-tags-changed/shopify.extension.toml...
╭─ error ──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Duplicated handle "discount-add-customer" in extensions "ディスカウントに利用可能な顧客を追加する", │
│ "ディスカウントに利用可能な顧客を追加する" and "ディスカウントに利用可能な顧客を追加する". Handle needs to be │
│ unique per extension. │
│ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Reproduction steps
- npm run deploy
Operating System
Mac OS
Shopify CLI version (shopify --version)
3.77.1
Shell
No response
Node version (run node -v if you're not sure)
No response
What language and version are you using in your application?
No response
Hi @Yamashou! Looking at the verbose logs, I see:
2025-04-08T13:35:42.052Z: Reading the content of file at extensions/dev/discount-add-customer/shopify.extension.toml...
2025-04-08T13:35:42.052Z: Reading the content of file at extensions/staging/discount-add-customer/shopify.extension.toml...
2025-04-08T13:35:42.052Z: Reading the content of file at extensions/prod/discount-add-customer/shopify.extension.toml...
which explains the error Duplicated handle "discount-add-customer" in extensions if the handles in extensions/{dev|staging|prod} are the same.
To be unblocked, I believe you can make this change. (Let me know if it doesn't work!)
- extension_directories = ["extensions/*", "extensions/prod/*"]
+ extension_directories = ["extensions/", "extensions/prod/"]
Given that extensions_directories values are in the context of directory structures, I share your expectation for globbing syntax (rather than regex) and so would consider treating these strings as regex and not globs a bug, or at least very surprising and adding unnecessary friction. That said, I'm not sure what appetite there is for breaking change to this configuration, especially as its usage would become unnecessary in an ideal end state where we better ways for accomplishing staging, etc.
@craigmichaelmartin
I fixed it with what you told me, but it didn't work. All extensions will be removed when you deploy. Probably all the files are missing.
Can you include the verbose logs and overview of your extension directory structure?
This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.
P.S. You can learn more about why we stale issues here.
Hey @Yamashou , not sure I understand what the error is here. If you want to include just the prod extensions, the configuration should be
extension_directories = ["/extensions/prod/*"]
(If you add /extensions/* in there, that means "everything under the extensions directory")
I'll be closing this issue, as it isn't a CLI bug, but feel free to comment again if you still have problems. Or consider opening a post in the community forums https://community.shopify.com :)