Skip to content

Only use custom cli-hydrogen package in development#6574

Merged
amcaplan merged 1 commit intomainfrom
fix-invalid-json-parsing-issue-take-2
Nov 4, 2025
Merged

Only use custom cli-hydrogen package in development#6574
amcaplan merged 1 commit intomainfrom
fix-invalid-json-parsing-issue-take-2

Conversation

@amcaplan
Copy link
Contributor

@amcaplan amcaplan commented Nov 4, 2025

Summary

Fixes shop/issues-develop#21438 - CLI crash caused by malformed JSON in package.json during Hydrogen monorepo detection.

Problem

The CLI was crashing with error "Expected double-quoted property name in JSON" when the project's root package.json contained malformed JSON (trailing commas, missing quotes, etc.)

Error Impact:

  • 5 events, 2 affected users, 1 shop in last 7 days
  • Complete CLI failure - no commands could run

Cause

  • We check for a custom cli-hydrogen package and prefer it to the included package
  • This is only really useful in dev environments
  • The code only validated file existence, not JSON validity

Solution

  • Only do this workaround in development environments

@amcaplan amcaplan requested review from a team as code owners November 4, 2025 12:48
@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
79.24% (+0.01% 🔼)
13566/17121
🟡 Branches
73.07% (+0.03% 🔼)
6621/9061
🟡 Functions 79.36% 3498/4408
🟡 Lines
79.59% (+0.01% 🔼)
12812/16097

Test suite run success

3351 tests passing in 1372 suites.

Report generated by 🧪jest coverage report action from c30af25

@amcaplan amcaplan added this pull request to the merge queue Nov 4, 2025
Merged via the queue into main with commit e987aba Nov 4, 2025
30 checks passed
@amcaplan amcaplan deleted the fix-invalid-json-parsing-issue-take-2 branch November 4, 2025 13:22
@gonzaloriestra gonzaloriestra mentioned this pull request Nov 5, 2025
5 tasks
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.

2 participants