Skip to content

fix: handle //:name depends without crashing task graph - #274

Merged
hverlin merged 1 commit into
hverlin:mainfrom
tempusfrangit:fix/empty-pattern-taskgraph
Aug 5, 2026
Merged

fix: handle //:name depends without crashing task graph#274
hverlin merged 1 commit into
hverlin:mainfrom
tempusfrangit:fix/empty-pattern-taskgraph

Conversation

@tempusfrangit

Copy link
Copy Markdown
Contributor

//:name refers to a task at the monorepo root config root, so the pathPattern between // and : is empty. dependsPatternMatchesTask short-circuits when that empty string exactly matches a root target's config root, but for a target in a non-root config root it fell through to micromatch.isMatch(targetConfigRoot, "", ...), which picomatch rejects with Expected pattern to be a non-empty string. That path is hit for every non-root task while building the task graph, so a single //:name depends entry took the whole graph webview down.

Skip the micromatch call for an empty pathPattern (the exact-match branch already yields the correct answer for root-only targets), and guard matchesTaskName against empty patterns defensively so any other edge case that leaks an empty pattern returns false instead of throwing.

`//:name` refers to a task at the monorepo root config root, so the
`pathPattern` between `//` and `:` is empty. `dependsPatternMatchesTask`
short-circuits when that empty string exactly matches a root target's
config root, but for a target in a non-root config root it fell through
to `micromatch.isMatch(targetConfigRoot, "", ...)`, which picomatch
rejects with `Expected pattern to be a non-empty string`. That path is
hit for every non-root task while building the task graph, so a single
`//:name` depends entry took the whole graph webview down.

Skip the micromatch call for an empty pathPattern (the exact-match
branch already yields the correct answer for root-only targets), and
guard `matchesTaskName` against empty patterns defensively so any other
edge case that leaks an empty pattern returns `false` instead of
throwing.

Co-Authored-By: Claude <noreply@anthropic.com>
@hverlin

hverlin commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Thank you!

@hverlin
hverlin merged commit 9db4aae into hverlin:main Aug 5, 2026
3 checks passed
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