[GH-ISSUE #540] Vite 8: deprecated config options cause build warnings #113

Closed
opened 2026-05-06 12:37:19 +02:00 by BreizhHardware · 0 comments

Originally created by @Divkix on GitHub (Mar 15, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/540

Description

After upgrading to vinext 0.0.30 with Vite 8.0.0, the build produces warnings about deprecated config options:

Warning: Invalid input options (1 issue found)
- For the "treeshake.preset". Invalid key: Expected never but received "preset".

Warning: Invalid output options (1 issue found)
- For the "experimentalMinChunkSize". Invalid key: Expected never but received "experimentalMinChunkSize".

Exact Location

The deprecated options are defined in packages/vinext/src/index.ts:

Line 493-496 - experimentalMinChunkSize:

const clientOutputConfig = {
  manualChunks: clientManualChunks,
  experimentalMinChunkSize: 10_000,  // REMOVED in Vite 8 (Rolldown)
};

Line 523-526 - treeshake.preset:

const clientTreeshakeConfig = {
  preset: "recommended" as const,   // INVALID in Vite 8 (Rolldown)
  moduleSideEffects: "no-external" as const,
};

These configs are applied in multiple places:

  • Lines 1235, 1243 (multi-env builds)
  • Lines 1447-1448, 1466-1467 (Pages Router)
  • packages/vinext/src/cli.ts lines 390-391 (CLI builds)

Root Cause

Vite 8 uses Rolldown instead of Rollup. These options are Rollup-specific:

  1. experimentalMinChunkSize - This was a Rollup feature, removed in Vite 8/Rolldown. Rolldown handles chunk merging differently.

  2. treeshake.preset - This was a Rollup treeshake option. In Vite 8 with Rolldown, treeshake configuration should use build.rolldownOptions.treeshake instead.

Suggested Fix

Based on Vite 8 migration docs, the fix options are:

  1. Remove entirely - Vite 8/Rolldown has better default treeshaking
  2. Use Vite 8 config - Move treeshake config to build.rolldownOptions.treeshake
  3. Conditional application - Only apply these options when building with Vite 7

Example fix for treeshake:

// Instead of treeshake.preset, use:
build: {
  rolldownOptions: {
    treeshake: {
      moduleSideEffects: "no-external",
    },
  },
}

For experimentalMinChunkSize - this feature may need to be reimplemented differently or removed if Rolldown handles it automatically.

Impact

  • Build still works (Vite 8 silently ignores invalid keys)
  • Some optimizations may not be applied
  • Produces warning noise in CI/CD

Environment

  • vinext: 0.0.30
  • vite: 8.0.0
  • @cloudflare/vite-plugin: 1.28.0
Originally created by @Divkix on GitHub (Mar 15, 2026). Original GitHub issue: https://github.com/cloudflare/vinext/issues/540 ## Description After upgrading to vinext 0.0.30 with Vite 8.0.0, the build produces warnings about deprecated config options: ``` Warning: Invalid input options (1 issue found) - For the "treeshake.preset". Invalid key: Expected never but received "preset". Warning: Invalid output options (1 issue found) - For the "experimentalMinChunkSize". Invalid key: Expected never but received "experimentalMinChunkSize". ``` ## Exact Location The deprecated options are defined in `packages/vinext/src/index.ts`: **Line 493-496** - `experimentalMinChunkSize`: ```typescript const clientOutputConfig = { manualChunks: clientManualChunks, experimentalMinChunkSize: 10_000, // REMOVED in Vite 8 (Rolldown) }; ``` **Line 523-526** - `treeshake.preset`: ```typescript const clientTreeshakeConfig = { preset: "recommended" as const, // INVALID in Vite 8 (Rolldown) moduleSideEffects: "no-external" as const, }; ``` These configs are applied in multiple places: - Lines 1235, 1243 (multi-env builds) - Lines 1447-1448, 1466-1467 (Pages Router) - `packages/vinext/src/cli.ts` lines 390-391 (CLI builds) ## Root Cause Vite 8 uses **Rolldown** instead of Rollup. These options are Rollup-specific: 1. **`experimentalMinChunkSize`** - This was a Rollup feature, removed in Vite 8/Rolldown. Rolldown handles chunk merging differently. 2. **`treeshake.preset`** - This was a Rollup treeshake option. In Vite 8 with Rolldown, treeshake configuration should use `build.rolldownOptions.treeshake` instead. ## Suggested Fix Based on [Vite 8 migration docs](https://github.com/vitejs/vite/blob/main/docs/guide/migration.md), the fix options are: 1. **Remove entirely** - Vite 8/Rolldown has better default treeshaking 2. **Use Vite 8 config** - Move treeshake config to `build.rolldownOptions.treeshake` 3. **Conditional application** - Only apply these options when building with Vite 7 Example fix for treeshake: ```typescript // Instead of treeshake.preset, use: build: { rolldownOptions: { treeshake: { moduleSideEffects: "no-external", }, }, } ``` For `experimentalMinChunkSize` - this feature may need to be reimplemented differently or removed if Rolldown handles it automatically. ## Impact - Build still works (Vite 8 silently ignores invalid keys) - Some optimizations may not be applied - Produces warning noise in CI/CD ## Environment - vinext: 0.0.30 - vite: 8.0.0 - @cloudflare/vite-plugin: 1.28.0
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#113
No description provided.