Skip to content

Show actionable error when vite is missing in Hydrogen CLI#3796

Open
lucyxiang wants to merge 1 commit into
mainfrom
river-hydrogen-cli-vite-not-found-error
Open

Show actionable error when vite is missing in Hydrogen CLI#3796
lucyxiang wants to merge 1 commit into
mainfrom
river-hydrogen-cli-vite-not-found-error

Conversation

@lucyxiang

Copy link
Copy Markdown
Contributor

importVite() resolved vite from the user's project root and let a raw MODULE_NOT_FOUND ("Cannot find module 'vite'") propagate when the package was not installed there (e.g. running a hydrogen command outside the app directory or before installing dependencies). Because it was unhandled, it is reported a crash.

Catch the missing-module case and throw a handled AbortError with actionable next steps. Handled errors print cleanly and are not reported as crashes; any other resolution error is re-thrown unchanged.

WHY are these changes introduced?

Fixes #0000

WHAT is this pull request doing?

HOW to test your changes?

Post-merge steps

Checklist

  • I've read the Contributing Guidelines
  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've added a changeset if this PR contains user-facing or functional changes. Test changes or internal-only config changes do not require a changeset.
  • I've added tests to cover my changes
  • I've added or updated the documentation

`importVite()` resolved `vite` from the user's project root and let a raw
`MODULE_NOT_FOUND` ("Cannot find module 'vite'") propagate when the package
was not installed there (e.g. running a hydrogen command outside the app
directory or before installing dependencies). Because it was unhandled, it
was reported to Bugsnag as a crash.

Catch the missing-module case and throw a handled `AbortError` with
actionable next steps. Handled errors print cleanly and are not reported as
crashes; any other resolution error is re-thrown unchanged.
@shopify

shopify Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Oxygen deployed a preview of your river-hydrogen-cli-vite-not-found-error branch. Details:

Storefront Status Preview link Deployment details Last update (UTC)
Skeleton (skeleton.hydrogen.shop) ✅ Successful (Logs) Preview deployment Inspect deployment June 10, 2026 4:03 PM

Learn more about Hydrogen's GitHub integration.

@lucyxiang lucyxiang marked this pull request as ready for review June 10, 2026 16:46
@lucyxiang lucyxiang requested a review from a team as a code owner June 10, 2026 16:46
@lucyxiang lucyxiang requested review from andguy95 and fredericoo June 10, 2026 18:40

@frandiox frandiox left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

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