Conversation
## Current Behavior Vite 8.2 warns that Nx-generated configs use features `configLoader: 'native'` cannot support: - `__dirname` in `vitest.config.mts` - ESM syntax in a CommonJS-loaded root `vitest.config.ts` `@nx/vite` fixed this in 22.1.1. `@nx/vitest` forked before that and kept `__dirname`. ## Expected Behavior No warning. - `__dirname` -> `import.meta.dirname` (3 sites, matching `@nx/vite`) - root aggregator written as `vitest.config.mts` - vitest 3 `vitest.workspace.ts` -> `.mts` - nuxt emits `.mts` unless the workspace is on eslintrc, where legacy `@nuxt/eslint-config` cannot parse it - migration backfills `__dirname` in existing `.mts`/`.mjs` configs ## Related Issue(s) NXC-4772
✅ 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. |
Contributor
|
View your CI Pipeline Execution ↗ for commit f04b875
☁️ Nx Cloud last updated this comment at |
## Current Behavior
The migration rewrote `__dirname` anywhere it appeared as an identifier,
including positions where `import.meta.dirname` is not legal syntax:
- `const { __dirname: dir } = opts`
- `import { __dirname as dir } from './paths.mjs'`
- `export { __dirname } from './paths.mjs'`
Each produced an unparseable config.
## Expected Behavior
Rename keys, aliased import specifiers, and re-exports are left alone. Real
references in the same file are still rewritten.
## Related Issue(s)
NXC-4772
…Healing CI Rerun]
… storybook ## Current Behavior Three generators write their vite config from a standalone template under `files/`, bypassing `createOrEditViteConfig`, so `useEsmExtension` never applied and they emitted `vite.config.ts`. ESM source in a `.ts` config loaded as CommonJS trips Vite's `configLoader: 'native'` warning. ## Expected Behavior All three emit `vite.config.mts`: - `@nx/react:consumer` - `@nx/react:provider` - `@nx/remix:storybook-configuration` The remix generator still skips generation when a `.ts` config already exists. ## Related Issue(s) NXC-4772
… storybook [Self-Healing CI Rerun]
FrozenPandaz
approved these changes
Aug 10, 2026
## Current Behavior Docs print the pre-rename filenames, so step one of a tutorial does not match what the reader sees: - provider/consumer trees show `vite.config.ts` - react, angular and typescript-packages workspace trees show a root `vitest.config.ts` The migration doc also read as though the CommonJS warning was fully handled. ## Expected Behavior Trees show `.mts`. The migration doc states that existing `.ts` configs are left alone by design, so that warning stays until the user renames the file or sets `"type": "module"`, and notes the one generated `.ts` case (nuxt on eslintrc). Also from review: `classify` now excludes every parent name position rather than enumerating node kinds, so class fields, accessors and enum members are no longer rewritten into invalid syntax; configs with parse errors are skipped; the workspace-file extension guards match the inference plugin's list. ## Related Issue(s) NXC-4772
Contributor
There was a problem hiding this comment.
Nx Cloud has identified a flaky task in your failed CI:
🔂 Since the failure was identified as flaky, we triggered a CI rerun by adding an empty commit to this branch.
🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.
🎓 Learn more about Self-Healing CI on nx.dev
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Current Behavior
Vite 8.2 warns that Nx-generated configs use features
configLoader: 'native'cannot support:__dirnameinvitest.config.mts, and ESM syntax in a CommonJS-loaded rootvitest.config.ts.@nx/vitefixed this in 22.1.1;@nx/vitestforked before that and kept__dirname.Expected Behavior
No warning.
__dirnamebecomesimport.meta.dirname, the root aggregator and the vitest 3 workspace file are written as.mts, and a migration backfills__dirnamein existing.mts/.mjsconfigs.Related Issue(s)
NXC-4772
View Polygraph session ↗