Visitar URL original
fix(misc): stop generators from accepting targets on removed executors by leosvelperez · Pull Request #37475 · nrwl/nx · GitHub
Skip to content

fix(misc): stop generators from accepting targets on removed executors - #37475

Merged
FrozenPandaz merged 9 commits into
masterfrom
cleanup/removed-executor-leftovers
Oct 19, 2026
Merged

FrozenPandaz merged 9 commits into
masterfrom
cleanup/removed-executor-leftovers

Conversation

@leosvelperez

@leosvelperez leosvelperez commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Current Behavior

Nx 24 removed 35 executors in #37160. Several setup generators still detect or accept targets on them:

  • @nx/react:cypress-component-configuration accepts build targets on @nx/webpack:webpack and @nx/vite:build. It ignores a project.json target that replaces the inferred build target, unless --build-target names it.
  • @nx/vite:configuration and @nx/rspack:configuration convert projects that still have targets on removed executors. A leftover target replaces the inferred target of the same name. The converted project keeps running the removed executor.
  • The Storybook, React, ESLint and plugin lint-checks generators keep lookups that only match removed executors.
  • Generator examples and option descriptions still name the removed executors.

Expected Behavior

  • The component testing generator only uses a build target that @nx/vite/plugin or @nx/webpack/plugin infers. Otherwise it fails. When a target on another executor is in the way, the error suggests converting it with nx g @nx/workspace:infer-targets.
  • The Vite and Rspack configuration generators stop before they change anything when a build or serve target uses a removed executor. The error tells the user to convert that target first.
  • The other generators don't check for removed executors.
  • Examples and option descriptions describe inferred targets.

Implementation Notes

  • Scope: setup generators that detect or accept targets on the executors feat(misc): remove deprecated executors #37160 removed, plus their examples and option descriptions. A generator refuses such a target where accepting it would write a broken project. Elsewhere the generator drops the lookup.
  • Not in this PR:
    • Generators that repair old targets, like convert-to-inferred and the ones migrations call. They must keep matching the removed executors.
    • Runtime code. The React and Angular component testing presets still read the removed Cypress executor's devServerTarget option when their options have no buildTarget.
    • The Jest configuration generator's @nx/jest:jest match. Moving a root project's Jest config only completes through it, so removing it needs a fix for inferred test targets first.
    • @nx/cypress:migrate-to-cypress-11, which only acts on @nx/cypress:cypress targets. Removing a public generator is a change of its own.
    • A build dependency for inferred lint targets. The lint-checks generator only gave one to @nx/eslint:lint targets that list lintFilePatterns. Plugin lint can still read build outputs it doesn't declare.
    • Files that feat(misc): remove deprecated executors #37160 left in removed executor directories and that other code still imports.
  • The Vite and Rspack generators each refuse the removed executors they used to convert, so their lists differ. Only Rspack lists @nrwl names, because it converted them before. Nx 16 migrations renamed @nrwl executors, and @nrwl plugins have no stable release after Nx 19.
  • @nx/eslint/internal drops the export of the removed lint executor's Schema type. The lint-checks code was its last user.
  • Three doc fixes predate the executor removal:
    • a --build-target: typo
    • a note about Storybook testing through Cypress, which Nx removed in 2024
    • a wrong rollup compiler default

@leosvelperez leosvelperez self-assigned this Oct 19, 2026
@netlify

netlify Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit efba23c
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/6ad5fe57b8b5e3e2d52dec3f
😎 Deploy Preview https://deploy-preview-37475--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

netlify Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit efba23c
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/6ad5fe57b3e94857dac32ad7
😎 Deploy Preview https://deploy-preview-37475--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

nx-cloud Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit efba23c

Command Status Duration Result
nx affected --targets=lint,oxlint,test,build,e2... ✅ Succeeded 36m 42s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 3s View ↗
nx-cloud record -- pnpm nx-cloud conformance:check ✅ Succeeded 47s View ↗
nx build workspace-plugin ✅ Succeeded <1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 32s View ↗
nx-cloud record -- nx format:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-10-19 12:08:04 UTC

…sting

The component testing generator still accepted build targets on the removed
`@nx/webpack:webpack` and `@nx/vite:build` executors, so it wrote a setup around a
build that can't run. Without `--build-target`, it ignored a project.json or
package.json target that replaces the inferred build target.

The generator now uses only a build target inferred by `@nx/vite/plugin` or
`@nx/webpack/plugin`, and checks the resolved target for an override. When a
target on another executor is in the way, the error suggests converting it with
`nx g @nx/workspace:infer-targets`.
`nx g @nx/vite:configuration` converted projects that still had targets on removed
executors such as `@nx/webpack:webpack`, `@nx/rollup:rollup` and `@nx/vite:build`.
A leftover target replaces the inferred target of the same name, so the converted
project kept running the removed executor.

The generator now stops before changing anything and asks to convert those
targets first. The supported build list drops `@nx/rollup:rollup`, which it now
refuses, and `@nx/js:babel`, which never existed. The config lookup stops
matching `@nrwl/vite:build` targets, and the examples page lists the executors
the generator checks.
`nx g @nx/rspack:configuration` treated targets on removed executors such as
`@nx/webpack:webpack` and `@nx/vite:build` as supported, and converted the
project around them. It refused targets on the removed `@nx/rspack` executors
only in some cases. A leftover target replaces the inferred target of the same
name, so the converted project kept running a removed executor.

The generator now stops before changing anything when a target uses one of those
executors, and asks to convert it first. The `buildTarget` and `serveTarget`
descriptions stop mentioning the Vite executors, and framework detection reads
`jestConfig` from any test target.
…xecutor

The lint-checks generator edited lint targets on `@nx/eslint:lint` that listed
`lintFilePatterns`. It added the plugin's JSON files to the patterns and made
lint depend on build. That executor no longer exists, so the code could only
touch targets that can't run. Inferred lint targets never got these changes.
The lint project and init generators still looked for targets on the removed
`@nx/eslint:lint` and `@nx/linter:eslint` executors. The `getEslintTargets`
helper and the executor's `Schema` type in `@nx/eslint/internal` had no
remaining users.
The Storybook utilities and the React stories and Storybook framework helpers
still matched targets on removed executors, including `@nx/next:build`,
`@nx/rollup:rollup`, `@nx/expo:build` and the `@nx/storybook` executors. The
Cypress build target error kept a framework hint that never matched, because it
received the target string split into characters. The vitest `testTarget`
description names the inferred target.
The rollup and vite library examples described `@nx/rollup:rollup` and
`@nx/vite:build` targets, and set the rollup compiler in project.json. They now
describe the targets the plugins infer, and set the compiler through `withNx` in
`rollup.config.cjs`. The `@nx/js:node` example linked `@nx/webpack:webpack` for
`buildLibsFromSource`, and now names the `NxAppWebpackPlugin` option.
The component testing example passed `--build-target:some-react-app:build`,
which the CLI parses as an unknown flag. A note pointed to Storybook testing
through Cypress, which Nx removed in 2024. The library examples said rollup
builds default to the `tsc` compiler, while the generated config uses `swc`.
…sal tests

The refusal tests for React component testing, Vite and Rspack matched
only the start of each error, so dropping the
`nx g @nx/workspace:infer-targets` suggestion kept them green. The
expected messages include the suggestion with each project's name.
@leosvelperez
leosvelperez force-pushed the cleanup/removed-executor-leftovers branch from 269d0ae to efba23c Compare October 19, 2026 11:26
@leosvelperez
leosvelperez marked this pull request as ready for review October 19, 2026 12:06
@leosvelperez
leosvelperez requested a review from a team as a code owner October 19, 2026 12:06
@FrozenPandaz
FrozenPandaz merged commit a34dff2 into master Oct 19, 2026
26 checks passed
@FrozenPandaz
FrozenPandaz deleted the cleanup/removed-executor-leftovers branch October 19, 2026 13:27
@github-actions

Copy link
Copy Markdown
Contributor

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 Oct 25, 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