Skip to content

Commit 65a6833

Browse files
pvdzBrittney Ball
authored andcommitted
chore(gatsby): Fix case where the error parser receives an array (#20730)
1 parent 4261851 commit 65a6833

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/gatsby/src/utils/api-runner-error-parser.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ const errorParser = ({ err }) => {
2525
let structured
2626

2727
for (const { regex, cb } of handlers) {
28-
const matched = err.message.match(regex)
28+
if (Array.isArray(err)) {
29+
err = err[0]
30+
}
31+
const matched = err.message?.match(regex)
2932
if (matched) {
3033
structured = {
3134
...cb(matched),

0 commit comments

Comments
 (0)