fix: Error reporting fails on undefined error index (#5539)
* fix: Error reporting fails on undefined error index * fix: add changeset * Update .changeset/slow-cherries-bake.md Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
This commit is contained in:
parent
fe0da0185a
commit
2c836b9d12
2 changed files with 6 additions and 1 deletions
5
.changeset/slow-cherries-bake.md
Normal file
5
.changeset/slow-cherries-bake.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Error reporting fails on undefined error index
|
|
@ -20,7 +20,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) {
|
||||
|
|
Loading…
Reference in a new issue