Skip to content

fix(devkit): drop build-base outputs override#35542

Merged
FrozenPandaz merged 1 commit into
masterfrom
fix-devkit-sandbox
May 2, 2026
Merged

fix(devkit): drop build-base outputs override#35542
FrozenPandaz merged 1 commit into
masterfrom
fix-devkit-sandbox

Conversation

@FrozenPandaz
Copy link
Copy Markdown
Contributor

@FrozenPandaz FrozenPandaz commented May 2, 2026

Current Behavior

@nx/devkit's build-base target overrode outputs in project.json:

"outputs": [
  "{projectRoot}/dist/**/*.{js,cjs,mjs,d.ts}",
  "{projectRoot}/*.d.ts",
  "{projectRoot}/src/**/*.d.ts"
]

This override is missing tsconfig.tsbuildinfo. Any downstream task whose inputs include dependentTasksOutputFiles: "**/*.{d.ts,d.cts,d.mts,tsbuildinfo}" (e.g. docker:build-base) trips a sandbox violation: when tsc --build walks 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-migration Claude 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/typescript plugin already reads outDir and tsBuildInfoFile from tsconfig.lib.json and infers a strictly more complete set of outputs:

{projectRoot}/dist/**/*.{js,cjs,mjs,jsx,json,d.ts,d.cts,d.mts}{,.map}
{projectRoot}/dist/tsconfig.tsbuildinfo

The inferred set picks up the tsbuildinfo plus .cjs/.mjs/.json/.d.cts/.d.mts/.map that the manual override was missing. Verified the violation is resolved:

$ pnpm nx show target inputs docker:build-base --check packages/devkit/dist/tsconfig.tsbuildinfo
✓ packages/devkit/dist/tsconfig.tsbuildinfo is an input for docker:build-base (depOutputs)

The dist-build-migration skill is updated to tell future migrations to leave build-base.outputs to the plugin.

Related Issue(s)

Follow-up to #34946.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 2, 2026

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit b19fcfa
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/69f5887d310f940008b53b1f
😎 Deploy Preview https://deploy-preview-35542--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 2, 2026

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit b19fcfa
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/69f5887df54b7f000836d42b
😎 Deploy Preview https://deploy-preview-35542--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented May 2, 2026

View your CI Pipeline Execution ↗ for commit b19fcfa

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 16m 41s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 3s View ↗
nx-cloud record -- pnpm nx-cloud conformance:check ✅ Succeeded 16s View ↗
nx build workspace-plugin ✅ Succeeded <1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 23s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 5s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-02 12:15:32 UTC

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.
@FrozenPandaz FrozenPandaz force-pushed the fix-devkit-sandbox branch from 6a882cd to b19fcfa Compare May 2, 2026 05:15
@FrozenPandaz FrozenPandaz changed the title fix(devkit): declare tsbuildinfo as build-base output fix(devkit): drop build-base outputs override May 2, 2026
Copy link
Copy Markdown
Contributor

@nx-cloud nx-cloud Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Rerun CI

Nx Cloud View detailed reasoning on Nx Cloud ↗


🎓 Learn more about Self-Healing CI on nx.dev

@FrozenPandaz FrozenPandaz marked this pull request as ready for review May 2, 2026 11:54
@FrozenPandaz FrozenPandaz requested a review from a team as a code owner May 2, 2026 11:54
@FrozenPandaz FrozenPandaz requested a review from leosvelperez May 2, 2026 11:54
@FrozenPandaz FrozenPandaz enabled auto-merge (squash) May 2, 2026 13:56
@FrozenPandaz FrozenPandaz merged commit f2872bb into master May 2, 2026
27 of 29 checks passed
@FrozenPandaz FrozenPandaz deleted the fix-devkit-sandbox branch May 2, 2026 14:12
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

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.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants