Repository navigation
Report Theme Check config directories as expected errors - #8988
Merged
Merged
Conversation
MillanWangShopify
added this pull request to stack #8990
October 22, 2026 16:04
MillanWangShopify
marked this pull request as ready for review
October 22, 2026 16:07
Check up front whether the explicitly selected Theme Check config is a directory, including through a symlink, and raise an AbortError for check, --print, and --list instead of crashing with EISDIR. The EISDIR raised by readFile often has no path, so it can't be matched after the failure like the missing-file case. Clarify in the --config flag description that it takes a file path and that --path sets the theme directory. Closes shop/issues#100399
MillanWangShopify
force-pushed
the
theme-check-config-directory-error
branch
from
October 22, 2026 17:41
5505e58 to
87cc186
Compare
isaacroldan
approved these changes
Oct 23, 2026
karreiro
approved these changes
Oct 23, 2026
karreiro
left a comment
Contributor
There was a problem hiding this comment.
Thank you, @MillanWangShopify!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WHY are these changes introduced?
Closes https://github.com/shop/issues/issues/100399
Vault issue: https://vault.shopify.io/teams/16949-Dev-Experience/issues/92571-error-eisdir-illegal-operation-on-a-directory-read
shopify theme check -C .(or--config <dir>, with--printand--listtoo) crashes withEISDIR: illegal operation on a directory, read. Theme Check reads the config withreadFile, and the failure is reported as an unhandled CLI error. Many CLIs use-C <dir>to mean "run in this directory", but here-Cis the config file, and--pathsets the theme folder.WHAT is this pull request doing?
AbortErrorwith a next step forcheck,--printand--list. It checks up front because theEISDIRthatreadFileraises often has nopath, so it can't be matched after the failure like the existing missing-file case.fileRealPath), because cli-kit'sisDirectoryuseslstat, so a symlink to a directory is caught too.ModernIdentifiersand missing paths, so missing files still produce "Theme Check config file not found".--configflag description say it takes a file path and that--pathsets the theme directory.Known limitation, to fix in Shopify/theme-tools: a directory named
.theme-check.ymlin the theme root (discovery only usesfs.stat), andextends:entries that point to a directory, still crash. Both need a theme-check-node release.Before:
After:
How to manually test your changes?
Checklist
patchfor bug fixes ·minorfor new features ·majorfor breaking changes) and added a changeset withpnpm changeset add