Describe the bug
As
|
ViteLessManager ??= class ViteManager extends FileManager { |
shows, the
less css adapter requires the less API
FileManager.
However, less 5 removes this API (less/less.js@937d1e4), result in the following error:
[plugin vite:css] src/index.less:undefined:undefined
Error: [less] Class extends value undefined is not a constructor or null at process (node_modules/vite/dist/node/chunks/node.js:23770:45)
at async compileCSSPreprocessors (node_modules/vite/dist/node/chunks/node.js:23041:27)
at async compileCSS (node_modules/vite/dist/node/chunks/node.js:23069:30)
at async TransformPluginContextImpl.handler (node_modules/vite/dist/node/chunks/node.js:22556:47)
at async plugin (node_modules/rolldown/dist/shared/bindingify-input-options-C-Zsy1EG.mjs:1537:16)
at async plugin.<computed> (node_modules/rolldown/dist/shared/bindingify-input-options-C-Zsy1EG.mjs:2125:12)
Reproduction
https://stackblitz.com/edit/vitejs-vite-392jf7f8
Steps to reproduce
Run npm install followed by npm run build
System Info
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 22.22.3 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.8.2 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
vite: ^8.2.0 => 8.2.1
Used Package Manager
npm
Logs
Click to expand!
✗ Build failed in 5.15s
error during build:
Build failed with 1 error:
Error: [less] Class extends value undefined is not a constructor or null
at napi_create_error (file:///tmp/rolldown-1.2.4/node_modules/.pnpm/@emnapi+core@2.0.0-alpha.4/node_modules/@emnapi/core/dist/emnapi-core.js:4610:23)
at napi_create_error (file:///tmp/rolldown-1.2.4/node_modules/.pnpm/@emnapi+core@2.0.0-alpha.4/node_modules/@emnapi/core/dist/emnapi-core.js:4610:23)
at aggregateBindingErrorsIntoJsError (file:///home/projects/vitejs-vite-392jf7f8/node_modules/rolldown/dist/shared/error-CVc7IgvG.mjs:67:18)
at Module.unwrapBindingResult (file:///home/projects/vitejs-vite-392jf7f8/node_modules/rolldown/dist/shared/error-CVc7IgvG.mjs:37:128)
at #build (file:///home/projects/vitejs-vite-392jf7f8/node_modules/rolldown/dist/shared/rolldown-DiYVDns9.mjs:147:54)
at async buildEnvironment (file:///home/projects/vitejs-vite-392jf7f8/node_modules/vite/dist/node/chunks/node.js:33814:66)
at async Object.build (file:///home/projects/vitejs-vite-392jf7f8/node_modules/vite/dist/node/chunks/node.js:34234:19)
at async Object.buildApp (file:///home/projects/vitejs-vite-392jf7f8/node_modules/vite/dist/node/chunks/node.js:34231:153)
at async CAC.eval (file:///home/projects/vitejs-vite-392jf7f8/node_modules/vite/dist/node/cli.js:791:3) {
errors: [Getter/Setter]
}
Validations
Describe the bug
As
vite/packages/vite/src/node/plugins/css.ts
Line 2910 in dcf88bd
shows, the
lesscss adapter requires the less APIFileManager.However, less 5 removes this API (less/less.js@937d1e4), result in the following error:
Reproduction
https://stackblitz.com/edit/vitejs-vite-392jf7f8
Steps to reproduce
Run
npm installfollowed bynpm run buildSystem Info
System: OS: Linux 5.0 undefined CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 22.22.3 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 10.8.2 - /usr/local/bin/npm pnpm: 8.15.6 - /usr/local/bin/pnpm npmPackages: vite: ^8.2.0 => 8.2.1Used Package Manager
npm
Logs
Click to expand!
Validations