Skip to content

"Both esbuild and oxc options were set" on Vite 8.0.0-beta.16 + Vitest 4.1.0-beta.6 #9800

@wojtekmaj

Description

@wojtekmaj

Describe the bug

When running unit tests, I'm seeing a warning:

Both esbuild and oxc options were set. oxc options will be used and esbuild options will be ignored. The following esbuild options were set: `{ legalComments: 'inline' }`

The thing is, neither in my vitest.config.ts nor vite.config.ts I have esbuild.legalComments option set. I only have build.rolldownOptions.output.legalComments set.

I believe this comes from the following default:

if (viteConfig.esbuild !== false) {
viteConfig.esbuild ||= {}
viteConfig.esbuild.legalComments = 'inline'
}

but following intuition and setting esbuild: false in my Vitest config, I just get a different warning:

`esbuild` option is set to false, but `oxc` option was not set to false. `esbuild: false` does not have effect any more. If you want to disable the default transformation, which is now handled by Oxc, please set `oxc: false` instead.

Reproduction

I believe I have provided sufficient information for this bug to be resolved. If I'm mistaken, please let me know!

System Info

System:
    OS: macOS 26.3
    CPU: (10) arm64 Apple M1 Max
    Memory: 834.45 MB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 24.11.1 - /usr/local/bin/node
    Yarn: 4.10.3 - /Users/wojciech.maj/.yarn/switch/bin/yarn
    npm: 11.6.2 - /usr/local/bin/npm
  Browsers:
    Chrome: 144.0.7559.134
    Firefox: 141.0.3
    Safari: 26.3

Used Package Manager

npm

Validations

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions