Skip to content

No deprecation warning when optimizeDeps.rollupOptions is set in the config #23749

Closed

Description

@atharv1205

Describe the bug

optimizeDeps.rollupOptions is deprecated in favor of optimizeDeps.rolldownOptions, but setting it directly in vite.config prints no deprecation warning. The value still works (it is mapped to rolldownOptions), so there is nothing telling users to migrate before the option is removed.

The same option returned from a plugin's config hook, or set under environments.client.optimizeDeps, does print the warning.

The cause is in setupRollupOptionCompat (packages/vite/src/node/utils.ts): it runs rolldownOptions ??= rollupOptions before checking rollupOptions && rolldownOptions !== rollupOptions. When only rollupOptions is set, both point to the same object by the time of the check, so the warning is skipped.

Expected: the deprecation warning is printed once, same as when a plugin sets the option.

I'd like to submit a PR for this.

Reproduction

https://github.com/atharv1205/vite-optimizedeps-rollupoptions-warning

Steps to reproduce

  1. npm install
  2. npm run build: uses vite.config.js with optimizeDeps.rollupOptions set. No warning.
  3. npm run build:plugin: the same option returned from a plugin. The deprecation warning is printed.

System Info

  System:
    OS: macOS 27.0.1
    CPU: (10) arm64 Apple M2 Pro
    Memory: 392.13 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.22.3
    Yarn: 1.22.22
    npm: 10.9.8
    pnpm: 11.1.2
  Browsers:
    Chrome: 155.0.8059.40
    Safari: 27.0.1
  npmPackages:
    vite: 8.3.4

Used Package Manager

npm

Logs

Output of npm run build:plugin (nothing like this appears for npm run build):

`optimizeDeps.rollupOptions` / `ssr.optimizeDeps.rollupOptions` is deprecated. Use `optimizeDeps.rolldownOptions` instead. Note that this option may be set by a plugin. Set VITE_DEPRECATION_TRACE=1 to see where it is called.

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guidelines.
  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Make sure this is a Vite issue and not a framework-specific issue.
  • Check that this is a concrete bug.
  • The provided reproduction is a minimal reproducible example of the bug.

Activity

  1. locked and limited conversation to collaborators on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions