Skip to content

fix: stop emitting the envFile deprecation warning on Vite 8 - #266

Merged
AlemTuzlak merged 1 commit into
code-forge-io:mainfrom
bravo-kernel:fix/vite8-envfile-deprecation
Jul 28, 2026
Merged

fix: stop emitting the envFile deprecation warning on Vite 8#266
AlemTuzlak merged 1 commit into
code-forge-io:mainfrom
bravo-kernel:fix/vite8-envfile-deprecation

Conversation

@bravo-kernel

@bravo-kernel bravo-kernel commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

What

The vite-node server passes envFile: false to createServer. Vite 8 deprecated that option in favour of envDir: false, so every Vite 8 consumer sees this on startup:

The `envFile` option is deprecated, please use `envDir: false` instead.

The key is now picked from the installed Vite major: envDir: false on 8+, envFile: false below.

Why

The warning is emitted from a top-level createServer call inside the plugin, so no consumer config can reach or suppress it — the fix has to be here.

Gated rather than renamed outright because the vite peer range is >=5.0.0. I verified envDir: false is honoured on 7 and 8, but not on 5/6; gating leaves those paths byte-for-byte unchanged.

Also included: a red-CI fix

packages/react-router-devtools/package.json is reformatted ("files": ["dist"] back onto one line). The release bot rewrote it in becd7c9 and the Validation Pipeline did not run on that commit, so biome ci . has been failing on main ever since and every PR inherits the red check. Happy to split it out if you would rather land it separately.

Verified

Same inline config both ways on Vite 8.1.3:

--- envFile: false (current) ---
The `envFile` option is deprecated, please use `envDir: false` instead.
   resolved envDir = false
--- envDir: false (patched) ---
   resolved envDir = false

Identical resolved config, no warning.

biome ci . is clean, test:types passes, test:lib passes.

Note that test-apps/react-router-v8-vite does not reproduce this: inside the workspace the package resolves its own vite@7.2.2 devDependency rather than the app's Vite 8, so the warning only appears in a real consumer install.

Changeset included (patch).

@pkg-pr-new

pkg-pr-new Bot commented Jul 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/react-router-devtools@266

commit: 40a22a2

The vite-node server passes `envFile: false` to `createServer`, which Vite 8
deprecated in favour of `envDir: false`. Pick the key from the installed Vite
major so Vite 8 stops warning while the `>=5` peers keep the old key.

Also reformats `packages/react-router-devtools/package.json`, which the
release bot rewrote in becd7c9 without the Validation Pipeline running. That
left `biome ci` failing on main, so every PR since inherits a red check.
@bravo-kernel
bravo-kernel force-pushed the fix/vite8-envfile-deprecation branch from 1d3bd6f to 40a22a2 Compare July 25, 2026 15:17
@bravo-kernel

Copy link
Copy Markdown
Contributor Author

I think the docs build failure is unrelated.

@AlemTuzlak
AlemTuzlak merged commit a816df1 into code-forge-io:main Jul 28, 2026
5 of 6 checks passed
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.

2 participants