Skip to content

Report missing Theme Check config files as expected errors - #8257

Merged
gonzaloriestra merged 1 commit into
mainfrom
alex/fix-theme-check-missing-config
Aug 7, 2026
Merged

Report missing Theme Check config files as expected errors#8257
gonzaloriestra merged 1 commit into
mainfrom
alex/fix-theme-check-missing-config

Conversation

@alexanderMontague

Copy link
Copy Markdown
Contributor

TL;DR

Report an explicitly selected but missing Theme Check configuration file as an expected CLI error instead of sending an unhandled filesystem error to Bugsnag and Observe.

Context

Observe error group 1547901448068571580 recorded 11 events over the inspected 30-day window, affecting 11 stable sessions. The error was consistently ENOENT: no such file or directory, open '<path>/.theme-check.yml' from @shopify/theme-check-node after the user supplied --config=./.theme-check.yml. The issue snapshot recorded 7 events affecting 7 users over seven days.

The Theme Check library correctly raises ENOENT when an explicit root config does not exist, but Shopify CLI treated that raw Node error as an unexpected bug. The command should still exit unsuccessfully and explain the missing file; it should not report expected invalid input as a product defect.

Closes https://github.com/shop/issues/issues/71880

Changes

  • Translate ENOENT into AbortError only when the missing path matches the explicitly selected root configuration file.
  • Apply the same behavior to normal checks, --print, and --list.
  • Preserve unexpected reporting for missing nested extends files, unrelated missing files, permission errors, and all other I/O failures.
  • Add command- and service-level regression coverage.
  • Add a patch changeset for @shopify/theme.

Tophatting

  • pnpm exec vitest run packages/theme/src/cli/services/check.test.ts packages/theme/src/cli/commands/theme/check.test.ts — 24 tests passed after rebasing onto current main.
  • Full @shopify/theme test suite — 576 tests passed.
  • dev check — type-check and lint passed.
  • pnpm nx build cli — passed.
  • Manually ran theme check, theme check --print, and theme check --list with a missing explicit config; each printed Theme Check config file not found: <path>, omitted a stack trace, and exited with status 1.
  • Local Binks review: no comments.

Generated with Pi. Vetted by Me.


Generated with Pi. Vetted by Me.

@alexanderMontague
alexanderMontague marked this pull request as ready for review August 6, 2026 16:40
@alexanderMontague
alexanderMontague requested a review from a team as a code owner August 6, 2026 16:40

@graygilmore graygilmore 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.

👍🏻 🎩

Translate an ENOENT for the explicitly selected Theme Check config into AbortError for check, --print, and --list. This gives developers actionable output and classifies the failure as expected instead of reporting it to Bugsnag and Observe.

Continue re-raising missing extended configs, unrelated missing files, and non-ENOENT I/O failures so genuine CLI defects remain visible.

Closes shop/issues#71880
@gonzaloriestra
gonzaloriestra force-pushed the alex/fix-theme-check-missing-config branch from 27a5aca to 81c77bf Compare August 7, 2026 06:38
@github-actions github-actions Bot added the Area: @shopify/theme @shopify/theme package issues label Aug 7, 2026
@gonzaloriestra
gonzaloriestra added this pull request to the merge queue Aug 7, 2026
Merged via the queue into main with commit be87327 Aug 7, 2026
29 checks passed
@gonzaloriestra
gonzaloriestra deleted the alex/fix-theme-check-missing-config branch August 7, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: @shopify/theme @shopify/theme package issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants