Skip to content

Fix locale-param flag sharing same env var as adapter flag#3693

Open
J8118 wants to merge 2 commits intoShopify:mainfrom
J8118:fix/duplicate-env-var-generate-route
Open

Fix locale-param flag sharing same env var as adapter flag#3693
J8118 wants to merge 2 commits intoShopify:mainfrom
J8118:fix/duplicate-env-var-generate-route

Conversation

@J8118
Copy link
Copy Markdown
Contributor

@J8118 J8118 commented Apr 10, 2026

Summary

In generate/route.ts, both the adapter flag (line 24) and the locale-param flag (line 33) use the same environment variable SHOPIFY_HYDROGEN_FLAG_ADAPTER. If a user sets this env var, oclif will use the value for both flags — an adapter name like @shopify/remix-oxygen will also be used as the locale param name, which is clearly wrong.

File changed:

  • packages/cli/src/commands/hydrogen/generate/route.ts (line 33)

Before:

'locale-param': Flags.string({
  description: 'The param name in Remix routes for the i18n locale...',
  env: 'SHOPIFY_HYDROGEN_FLAG_ADAPTER',
}),

After:

'locale-param': Flags.string({
  description: 'The param name in Remix routes for the i18n locale...',
  env: 'SHOPIFY_HYDROGEN_FLAG_LOCALE_PARAM',
}),

@J8118 J8118 requested a review from a team as a code owner April 10, 2026 09:09
Copy link
Copy Markdown
Contributor

@fredericoo fredericoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - copy-paste bug, both flags sharing the same env var is clearly wrong.

Copy link
Copy Markdown
Contributor

@fredericoo fredericoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a changeset, as this impacts users. it seems like no one has used this as no one has ever flagged anything!

@J8118
Copy link
Copy Markdown
Contributor Author

J8118 commented Apr 16, 2026

Done — just pushed a changeset to the branch.

@J8118 J8118 requested a review from fredericoo April 16, 2026 21:42
J8118 added 2 commits April 17, 2026 02:27
Both the adapter and locale-param flags used SHOPIFY_HYDROGEN_FLAG_ADAPTER.
Setting this env var would incorrectly set both flags to the same value.
Changed locale-param to use SHOPIFY_HYDROGEN_FLAG_LOCALE_PARAM.
@J8118 J8118 force-pushed the fix/duplicate-env-var-generate-route branch from 62ca3cc to 19c2a4d Compare April 16, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants