You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Without "dependsOn": ["^compile"], Nx can schedule test:types in parallel with the dependency's compile task, leading to race conditions where the dependency's dist-ts is not yet generated. This produces intermittent CI failures such as:
error TS2305: Module '"@tanstack/query-core"' has no exported member 'DefaultError'
These failures typically disappear on CI re-run because the previous run's cached dist-ts is available via Nx Cloud.
Scope
This affects nearly all packages in the monorepo. Any package that declares references in its tsconfig benefits from this fix, including all query adapters (react-query, preact-query, vue-query, solid-query, svelte-query), all devtools, all persist-client packages, and others.
Consistency
Other targets that depend on types (test:eslint, test:lib) already declare "dependsOn": ["^compile"]. This change brings test:types in line with that pattern.
A task dependency was added to the test:types target in the Nx configuration, requiring upstream compile tasks to execute first. This modifies the execution order while maintaining existing caching and input configurations.
Changes
Cohort / File(s)
Summary
Nx Configuration nx.json
Added dependsOn: ["^compile"] to the test:types task, establishing a dependency relationship that ensures compile tasks run before type tests.
Estimated code review effort
🎯 1 (Trivial) | ⏱️ ~2 minutes
Poem
🐰 A single line, so neat and small,
Dependencies dance in proper call,
Compile first, then types must play,
Order matters in the CI way! 🚀
The title clearly and specifically describes the main change: adding a dependency to the test:types target in nx.json with concise, technical language.
Docstring Coverage
✅ Passed
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check
✅ Passed
The pull request description is well-structured, follows the template, and provides comprehensive context for the change.
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches📝 Generate docstrings
Create stacked PR
Commit on current branch
🧪 Generate unit tests (beta)
Create PR with unit tests
Commit unit tests in branch ci/nx-test-types-depends-on-compile
Comment @coderabbitai help to get the list of available commands and usage tips.
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
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.
🎯 Changes
Add
"dependsOn": ["^compile"]to thetest:typestarget innx.json.Why
test:typestasks reference declaration files from dependent packages via TypeScript project references. For example:Without
"dependsOn": ["^compile"], Nx can scheduletest:typesin parallel with the dependency'scompiletask, leading to race conditions where the dependency'sdist-tsis not yet generated. This produces intermittent CI failures such as:These failures typically disappear on CI re-run because the previous run's cached
dist-tsis available via Nx Cloud.Scope
This affects nearly all packages in the monorepo. Any package that declares
referencesin its tsconfig benefits from this fix, including all query adapters (react-query, preact-query, vue-query, solid-query, svelte-query), all devtools, all persist-client packages, and others.Consistency
Other targets that depend on types (
test:eslint,test:lib) already declare"dependsOn": ["^compile"]. This change bringstest:typesin line with that pattern.✅ Checklist
pnpm run test:pr.🚀 Release Impact