Skip to content

fix: warn on deprecated envFile#22555

Merged
bluwy merged 5 commits into
vitejs:mainfrom
SSDWGG:codex/envfile-deprecation-warning
Jun 18, 2026
Merged

fix: warn on deprecated envFile#22555
bluwy merged 5 commits into
vitejs:mainfrom
SSDWGG:codex/envfile-deprecation-warning

Conversation

@SSDWGG

@SSDWGG SSDWGG commented May 30, 2026

Copy link
Copy Markdown

What changed

Why

envFile is already marked deprecated in the type definition, but the runtime path stayed silent. This makes migration harder for programmatic API users and leaves behavior inconsistent with other deprecated Vite options that warn when used.

Impact

Users who still pass envFile: false now get a clear migration hint without changing behavior. Consumers already on envDir: false keep the same experience with no extra warning.

Validation

  • pnpm vitest run packages/vite/src/node/__tests__/config.spec.ts -t "envFile option|envDir to disable env files"
  • pnpm exec eslint packages/vite/src/node/config.ts packages/vite/src/node/__tests__/config.spec.ts
  • pnpm exec oxfmt --check packages/vite/src/node/config.ts packages/vite/src/node/__tests__/config.spec.ts docs/guide/migration.md

@SSDWGG SSDWGG marked this pull request as ready for review May 30, 2026 09:45
@SSDWGG

SSDWGG commented May 30, 2026

Copy link
Copy Markdown
Author

I checked the remaining red check. The Vite CI matrix is green; the failing Run zizmor job appears unrelated to this change and fails before auditing this PR because it cannot list tags for actions-cool/issues-helper in .github/workflows/issue-close-require.yml (403 Forbidden from GitHub/git-upload-pack).

@truffle-dev

This comment was marked as low quality.

@truffle-dev

This comment was marked as low quality.

@bluwy

bluwy commented Jun 6, 2026

Copy link
Copy Markdown
Member

I noticed this PR only after reviewing #22569, since this PR is created first, if you can match the changes in #22569 I can merge this instead. I don't think we need the migration update and test here. Adding the warning log directly is fine.

@SSDWGG SSDWGG force-pushed the codex/envfile-deprecation-warning branch from b137eb1 to f38a82f Compare June 13, 2026 05:26
@SSDWGG

SSDWGG commented Jun 13, 2026

Copy link
Copy Markdown
Author

Updated this to match #22569: the PR now only adds the direct config.envFile deprecation warning in config.ts, without the migration entry or config tests.

@bluwy

bluwy commented Jun 15, 2026

Copy link
Copy Markdown
Member

You copied the PR but did not copy my review? #22569 (comment)

@SSDWGG

SSDWGG commented Jun 16, 2026

Copy link
Copy Markdown
Author

Updated the warning to match the review from #22569: it now uses colors.yellow with the shorter envFile deprecation message.

Comment thread packages/vite/src/node/config.ts Outdated
@bluwy bluwy merged commit ed7b283 into vitejs:main Jun 18, 2026
16 of 18 checks passed
AviVahl added a commit to AviVahl/react-router that referenced this pull request Jun 23, 2026
the new vite version started warning about this deprecated option being used.

envDir was added in vite@6.3.0, so react-router is safe to use it.

refs:
https://github.com/vitejs/vite/blob/v8.1.0/packages/vite/CHANGELOG.md
vitejs/vite#22555
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Jun 24, 2026
| datasource | package | from   | to    |
| ---------- | ------- | ------ | ----- |
| npm        | vite    | 8.0.14 | 8.1.0 |


## [v8.1.0](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#810-2026-06-23)

##### Features

- extend `server.fs.deny` list with common files ([#22707](vitejs/vite#22707)) ([61ba8fd](vitejs/vite@61ba8fd))
- update rolldown to 1.1.2 ([#22695](vitejs/vite#22695)) ([4f008a6](vitejs/vite@4f008a6))
- use `~` for Rolldown ([#22693](vitejs/vite#22693)) ([9928722](vitejs/vite@9928722))

##### Bug Fixes

- **bundled-dev:** errors should be kept when incremental build fails ([#22617](vitejs/vite#22617)) ([9a0dd48](vitejs/vite@9a0dd48))
- cache falsy values in perEnvironmentState ([#22715](vitejs/vite#22715)) ([0e91e79](vitejs/vite@0e91e79))
- **glob:** respect caseSensitive option in hmr matcher ([#22711](vitejs/vite#22711)) ([65f525e](vitejs/vite@65f525e))
- **html:** omit nonce on import map when cspNonce is unset ([#22713](vitejs/vite#22713)) ([8340bb5](vitejs/vite@8340bb5))
- **optimizer:** skip null-valued exports in expandGlobIds glob resolution ([#22611](vitejs/vite#22611)) ([8b9f5cd](vitejs/vite@8b9f5cd))
- resolved build options should be kept as a getter ([#22691](vitejs/vite#22691)) ([3527191](vitejs/vite@3527191))
- **server:** handle malformed URI in memory files middleware ([#22714](vitejs/vite#22714)) ([df9e0a5](vitejs/vite@df9e0a5))
- use literal envPrefix queries for Vite Task ([#22706](vitejs/vite#22706)) ([da72733](vitejs/vite@da72733))
- warn on deprecated envFile ([#22555](vitejs/vite#22555)) ([ed7b283](vitejs/vite@ed7b283))

##### Code Refactoring

- **client:** inline dev-id value in CSS selector ([#22736](vitejs/vite#22736)) ([57f59bc](vitejs/vite@57f59bc))
- remove unused removeRawQuery util ([#22724](vitejs/vite#22724)) ([403cc60](vitejs/vite@403cc60))
- use `rolldownOptions` property for chunkImportMap ([#22692](vitejs/vite#22692)) ([8e8816c](vitejs/vite@8e8816c))


## [v8.0.16](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-8016-2026-06-01-small)

##### Bug Fixes

- **deps:** reject UNC paths for launch-editor-middleware ([#22571](vitejs/vite#22571)) ([50b9512](vitejs/vite@50b9512))
- reject windows alternate paths ([#22572](vitejs/vite#22572)) ([dc245c7](vitejs/vite@dc245c7))


## [v8.0.15](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-8015-2026-06-01-small)

##### Features

- send 408 on request timeout ([#22476](vitejs/vite#22476)) ([c85c9ee](vitejs/vite@c85c9ee))
- update rolldown to 1.0.3 ([#22538](vitejs/vite#22538)) ([646dbed](vitejs/vite@646dbed))

##### Bug Fixes

- capitalize error messages and remove spurious space in parse error ([#22488](vitejs/vite#22488)) ([85a0eff](vitejs/vite@85a0eff))
- **deps:** update all non-major dependencies ([#22511](vitejs/vite#22511)) ([2686d7d](vitejs/vite@2686d7d))
- **dev:** fix html-proxy cache key mismatch for /@fs/ HTML paths ([#21762](vitejs/vite#21762)) ([47c4213](vitejs/vite@47c4213))
- **glob:** error on relative glob in virtual module when no files match ([#22497](vitejs/vite#22497)) ([5c8e98f](vitejs/vite@5c8e98f))
- **optimizer:** close the rolldown bundle when write() rejects ([#22528](vitejs/vite#22528)) ([e3cfb9d](vitejs/vite@e3cfb9d))
- **resolve:** provide onWarn for viteResolvePlugin in JS plugin containers ([#22509](vitejs/vite#22509)) ([40985f1](vitejs/vite@40985f1))

##### Miscellaneous Chores

- **deps:** update rolldown-related dependencies ([#22566](vitejs/vite#22566)) ([3052a67](vitejs/vite@3052a67))

##### Code Refactoring

- correct logic in `collectAllModules` function ([#22562](vitejs/vite#22562)) ([6978a9c](vitejs/vite@6978a9c))
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Jun 24, 2026
| datasource | package | from   | to    |
| ---------- | ------- | ------ | ----- |
| npm        | vite    | 8.0.14 | 8.1.0 |


## [v8.1.0](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#810-2026-06-23)

##### Features

- extend `server.fs.deny` list with common files ([#22707](vitejs/vite#22707)) ([61ba8fd](vitejs/vite@61ba8fd))
- update rolldown to 1.1.2 ([#22695](vitejs/vite#22695)) ([4f008a6](vitejs/vite@4f008a6))
- use `~` for Rolldown ([#22693](vitejs/vite#22693)) ([9928722](vitejs/vite@9928722))

##### Bug Fixes

- **bundled-dev:** errors should be kept when incremental build fails ([#22617](vitejs/vite#22617)) ([9a0dd48](vitejs/vite@9a0dd48))
- cache falsy values in perEnvironmentState ([#22715](vitejs/vite#22715)) ([0e91e79](vitejs/vite@0e91e79))
- **glob:** respect caseSensitive option in hmr matcher ([#22711](vitejs/vite#22711)) ([65f525e](vitejs/vite@65f525e))
- **html:** omit nonce on import map when cspNonce is unset ([#22713](vitejs/vite#22713)) ([8340bb5](vitejs/vite@8340bb5))
- **optimizer:** skip null-valued exports in expandGlobIds glob resolution ([#22611](vitejs/vite#22611)) ([8b9f5cd](vitejs/vite@8b9f5cd))
- resolved build options should be kept as a getter ([#22691](vitejs/vite#22691)) ([3527191](vitejs/vite@3527191))
- **server:** handle malformed URI in memory files middleware ([#22714](vitejs/vite#22714)) ([df9e0a5](vitejs/vite@df9e0a5))
- use literal envPrefix queries for Vite Task ([#22706](vitejs/vite#22706)) ([da72733](vitejs/vite@da72733))
- warn on deprecated envFile ([#22555](vitejs/vite#22555)) ([ed7b283](vitejs/vite@ed7b283))

##### Code Refactoring

- **client:** inline dev-id value in CSS selector ([#22736](vitejs/vite#22736)) ([57f59bc](vitejs/vite@57f59bc))
- remove unused removeRawQuery util ([#22724](vitejs/vite#22724)) ([403cc60](vitejs/vite@403cc60))
- use `rolldownOptions` property for chunkImportMap ([#22692](vitejs/vite#22692)) ([8e8816c](vitejs/vite@8e8816c))


## [v8.0.16](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-8016-2026-06-01-small)

##### Bug Fixes

- **deps:** reject UNC paths for launch-editor-middleware ([#22571](vitejs/vite#22571)) ([50b9512](vitejs/vite@50b9512))
- reject windows alternate paths ([#22572](vitejs/vite#22572)) ([dc245c7](vitejs/vite@dc245c7))


## [v8.0.15](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-8015-2026-06-01-small)

##### Features

- send 408 on request timeout ([#22476](vitejs/vite#22476)) ([c85c9ee](vitejs/vite@c85c9ee))
- update rolldown to 1.0.3 ([#22538](vitejs/vite#22538)) ([646dbed](vitejs/vite@646dbed))

##### Bug Fixes

- capitalize error messages and remove spurious space in parse error ([#22488](vitejs/vite#22488)) ([85a0eff](vitejs/vite@85a0eff))
- **deps:** update all non-major dependencies ([#22511](vitejs/vite#22511)) ([2686d7d](vitejs/vite@2686d7d))
- **dev:** fix html-proxy cache key mismatch for /@fs/ HTML paths ([#21762](vitejs/vite#21762)) ([47c4213](vitejs/vite@47c4213))
- **glob:** error on relative glob in virtual module when no files match ([#22497](vitejs/vite#22497)) ([5c8e98f](vitejs/vite@5c8e98f))
- **optimizer:** close the rolldown bundle when write() rejects ([#22528](vitejs/vite#22528)) ([e3cfb9d](vitejs/vite@e3cfb9d))
- **resolve:** provide onWarn for viteResolvePlugin in JS plugin containers ([#22509](vitejs/vite#22509)) ([40985f1](vitejs/vite@40985f1))

##### Miscellaneous Chores

- **deps:** update rolldown-related dependencies ([#22566](vitejs/vite#22566)) ([3052a67](vitejs/vite@3052a67))

##### Code Refactoring

- correct logic in `collectAllModules` function ([#22562](vitejs/vite#22562)) ([6978a9c](vitejs/vite@6978a9c))
brophdawg11 added a commit to remix-run/react-router that referenced this pull request Jun 25, 2026
* fix: warning with vite@8.1.0
the new vite version started warning about this deprecated option being used.

envDir was added in vite@6.3.0, so react-router is safe to use it.

refs:
https://github.com/vitejs/vite/blob/v8.1.0/packages/vite/CHANGELOG.md
vitejs/vite#22555

* docs: add a changelog entry

* Apply suggestion from @brophdawg11

---------

Co-authored-by: Matt Brophy <matt@brophy.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InlineConfig.envFile is deprecated but no runtime warning is emitted

3 participants