@shopify/hydrogen 2025.7.3 React-Router version mismatch detected warning #3431
-
|
Hello, I recently upgrade to @shopify/hydrogen 2025.7.3 and when I run a build I get the following warning: Hydrogen requires React-Router 7.9.x for proper functionality:
This may cause issues with routing, code splitting, and other features. What I do not understand is how the following older version of the dependency calls for React-Router 7.12.0 but 2025.7.3 asks for React-Router 7.9.2; Is anyone else running into this warning when using @shopify/hydrogen 2025.7.3? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
@miketen this is a bug in // @shopify/cli-hydrogen/dist/commands/hydrogen/dev.js
const EXPECTED_VERSION = "7.9.2"but hydrogen 2025.7.3 correctly declares do NOT downgrade to 7.9.x because it has 5 known CVEs (including path traversal). 7.12.0 is the right version. workaround until the CLI is fixed: add # suppress the warning
SHOPIFY_HYDROGEN_FLAG_DISABLE_WARNINGS=1 npx shopify hydrogen dev
# or in package.json scripts
"dev": "SHOPIFY_HYDROGEN_FLAG_DISABLE_WARNINGS=1 shopify hydrogen dev"the fix is tracked in Shopify/cli#6829 with PR #6845 pending. once ref: hydrogen 2025.7.3 changelog | react-router 7.12.0 release |
Beta Was this translation helpful? Give feedback.
@miketen this is a bug in
@shopify/cli, not in hydrogen or react-router. the CLI bundles a stale@shopify/cli-hydrogenthat has a hardcoded version check:but hydrogen 2025.7.3 correctly declares
react-router: ^7.12.0as a peerDep. the CLI just hasn't caught up.do NOT downgrade to 7.9.x because it has 5 known CVEs (including path traversal). 7.12.0 is the right version.
workaround until the CLI is fixed: add
SHOPIFY_HYDROGEN_FLAG_DISABLE_WARNINGS=1to suppress the version check, or pin the CLI: