Describe the bug
When trying to run vite build with an incorrect postcss.config.js file, vite fails (which is expected), but there are also unhandled errors thrown (in addition to the obvious error that postcss is failed to load).
In total there are 2 additional unhandled errors.
I suspect this is happening because postcss.config.js is processed in a separate thread, and this thread is throwing additional errors, which are not being handled correctly.
Reproduction
https://stackblitz.com/edit/vitejs-vite-ljmist?file=builder.js
Steps to reproduce
- Open the reproduction link
- Run
npm run build script in the terminal
- See vite build crash in the terminal
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: 18.20.3 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.2.3 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
vite: ^6.0.0 => 6.0.2
Used Package Manager
npm
Logs
No response
Validations
Describe the bug
When trying to run vite build with an incorrect
postcss.config.jsfile, vite fails (which is expected), but there are also unhandled errors thrown (in addition to the obvious error that postcss is failed to load).In total there are 2 additional unhandled errors.
I suspect this is happening because
postcss.config.jsis processed in a separate thread, and this thread is throwing additional errors, which are not being handled correctly.Reproduction
https://stackblitz.com/edit/vitejs-vite-ljmist?file=builder.js
Steps to reproduce
npm run buildscript in the terminalSystem 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: 18.20.3 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 10.2.3 - /usr/local/bin/npm pnpm: 8.15.6 - /usr/local/bin/pnpm npmPackages: vite: ^6.0.0 => 6.0.2Used Package Manager
npm
Logs
No response
Validations