fix(devkit): drop build-base outputs override#35542
Conversation
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
View your CI Pipeline Execution ↗ for commit b19fcfa
☁️ Nx Cloud last updated this comment at |
Let @nx/js/typescript infer outputs from tsconfig.lib.json. The plugin reads outDir and tsBuildInfoFile and produces a strictly more complete output set than the hand-written override (it covers the tsbuildinfo plus .cjs/.mjs/.json/.d.cts/.d.mts/.map). The missing tsbuildinfo from the override caused docker:build-base sandbox violations because tsc read devkit's tsbuildinfo through dependentTasksOutputFiles and Nx never registered it as a dep output. Update the dist-build-migration skill to recommend the same: don't override outputs in project.json, let the plugin infer them.
6a882cd to
b19fcfa
Compare
There was a problem hiding this comment.
Important
At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.
Nx Cloud has identified a possible root cause for your failed CI:
We investigated the plugin:test failure and determined it is unrelated to this PR. The error originates from a corrupted local Nx workspace-data hash file (eslint-*.hash is empty), causing a JSON parse failure in the should setup the eslint builder test — not from any code change introduced here. Clearing the Nx cache (nx reset) should resolve the environment state issue.
No code changes were suggested for this issue.
Trigger a rerun:
🎓 Learn more about Self-Healing CI on nx.dev
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
@nx/devkit'sbuild-basetarget overrodeoutputsinproject.json:This override is missing
tsconfig.tsbuildinfo. Any downstream task whose inputs includedependentTasksOutputFiles: "**/*.{d.ts,d.cts,d.mts,tsbuildinfo}"(e.g.docker:build-base) trips a sandbox violation: whentsc --buildwalks project references it reads devkit's tsbuildinfo, but Nx never registered that file as a dep output, so the read isn't covered by any declared input.The same gap exists in the
dist-build-migrationClaude skill, so every package migrated with that playbook would reproduce the violation.Sandbox report that surfaced this: https://staging.nx.app/runs/HNBpzgdeNi/task/docker%3Abuild-base/sandbox-report-raw?sandboxReportId=10b903d8-b860-41c7-80b2-756b0541e690
Expected Behavior
Drop the override entirely. The
@nx/js/typescriptplugin already readsoutDirandtsBuildInfoFilefromtsconfig.lib.jsonand infers a strictly more complete set of outputs:The inferred set picks up the tsbuildinfo plus
.cjs/.mjs/.json/.d.cts/.d.mts/.mapthat the manual override was missing. Verified the violation is resolved:The
dist-build-migrationskill is updated to tell future migrations to leavebuild-base.outputsto the plugin.Related Issue(s)
Follow-up to #34946.