Vite 5 printed The CJS build of Vite's Node API is deprecated whenever something did require('vite'). Vite 6 removed that build. Config files, plugins, and scripts that load Vite through require now fail outright rather than warning.
The warning is often produced by a tool rather than by the project, so the first step is finding the caller: run with VITE_CJS_TRACE=true on Vite 5 to print a stack trace identifying which file required Vite. That name is usually a test setup helper, a Storybook or framework integration, or a postcss config.
Fixes in order of preference: upgrade the offending tool to a version with ESM support, add "type": "module" to package.json so vite.config.js is treated as ESM, or rename the config to vite.config.mjs. A repository that cannot go ESM-first can keep CommonJS source and still use an .mjs config, since Vite loads the config independently of the project's module type.