From a9c926f4ae698b6fd2f44757cb2664da0219b47b Mon Sep 17 00:00:00 2001 From: wulinsheng123 <409187100@qq.com> Date: Tue, 6 Dec 2022 08:27:36 +0000 Subject: [PATCH 1/3] fix: Error reporting fails on undefined error index --- packages/astro/src/core/errors/dev/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/astro/src/core/errors/dev/utils.ts b/packages/astro/src/core/errors/dev/utils.ts index 54f1868bc5f9..134bb81ad697 100644 --- a/packages/astro/src/core/errors/dev/utils.ts +++ b/packages/astro/src/core/errors/dev/utils.ts @@ -18,7 +18,7 @@ export const incompatPackageExp = new RegExp(`(${Object.keys(incompatiblePackage * Useful for consistent reporting regardless of where the error surfaced from. */ export function collectErrorMetadata(e: any, rootFolder?: URL | undefined): ErrorWithMetadata { - const err = AggregateError.is(e) ? (e.errors as SSRError[]) : [e as SSRError]; + const err = AggregateError.is(e) || Array.isArray((e as any).errors) ? (e.errors as SSRError[]) : [e as SSRError]; err.forEach((error) => { if (error.stack) { From df27a5a138ac221b7ae218b73b2fe6c4681630a3 Mon Sep 17 00:00:00 2001 From: wulinsheng123 <409187100@qq.com> Date: Wed, 7 Dec 2022 05:51:31 +0000 Subject: [PATCH 2/3] fix: add changeset --- .changeset/slow-cherries-bake.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/slow-cherries-bake.md diff --git a/.changeset/slow-cherries-bake.md b/.changeset/slow-cherries-bake.md new file mode 100644 index 000000000000..7f32f5e55e83 --- /dev/null +++ b/.changeset/slow-cherries-bake.md @@ -0,0 +1,5 @@ +--- +'astro': minor +--- + +Error reporting fails on undefined error index From 84527062d8053ae5f0b81db3a0d7399078b10dde Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Wed, 7 Dec 2022 16:59:03 -0600 Subject: [PATCH 3/3] Update .changeset/slow-cherries-bake.md --- .changeset/slow-cherries-bake.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/slow-cherries-bake.md b/.changeset/slow-cherries-bake.md index 7f32f5e55e83..ed2837ca09cf 100644 --- a/.changeset/slow-cherries-bake.md +++ b/.changeset/slow-cherries-bake.md @@ -1,5 +1,5 @@ --- -'astro': minor +'astro': patch --- Error reporting fails on undefined error index