-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Description
Describe the bug
When an AggregateError is thrown during build, the console log doesn't print the errors that consist of it.
vite/packages/vite/src/node/cli.ts
Line 371 in d0d5fe4
| colors.red(`error during build:\n${e.stack}`), |
Reproduction
https://stackblitz.com/edit/vitejs-vite-amnehxld?file=vite.config.ts&terminal=dev
Steps to reproduce
- Prepare
vite.config.tswith below contents npm run build- See the error message and confirm that only
Aggregate erroris shown as error message, hiding concrete errors (Error 1andError 2)
import { defineConfig } from "vite";
export default defineConfig({
plugins: [
{
name: "repro-plugin",
async buildApp() {
const error1 = new Error("Error 1");
const error2 = new Error("Error 2");
throw new AggregateError([error1, error2], "Aggregate error");
}
}
],
});System Info
System:
OS: Linux 6.6 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
CPU: (16) x64 AMD Ryzen 7 PRO 6850U with Radeon Graphics
Memory: 7.54 GB / 15.01 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 24.13.1 - /home/uhyo/.volta/tools/image/node/24.13.1/bin/node
Yarn: 4.1.1 - /home/uhyo/.volta/tools/image/yarn/4.1.1/bin/yarn
npm: 11.4.2 - /home/uhyo/.volta/tools/image/npm/11.4.2/bin/npm
pnpm: 10.25.0 - /home/uhyo/.volta/bin/pnpm
Deno: 2.2.1 - /home/uhyo/.deno/bin/deno
npmPackages:
vite: ^8.0.0-beta.13 => 8.0.0-beta.15Used Package Manager
npm
Logs
> vite-project@0.0.0 build
> vite build
error during build:
AggregateError: Aggregate error
at BasicMinimalPluginContext.buildApp (file:///tmp/vite-project/node_modules/.vite-temp/vite.config.ts.timestamp-1771502762114-f6c51e4620c3.mjs:89:9)
at Object.buildApp (file:///tmp/vite-project/node_modules/vite/dist/node/chunks/node.js:33107:32)
at CAC.<anonymous> (file:///tmp/vite-project/node_modules/vite/dist/node/cli.js:641:17)
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. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable