diff --git a/packages/gatsby/src/internal-plugins/query-runner/graphql-errors.js b/packages/gatsby/src/internal-plugins/query-runner/graphql-errors.js index b59ab00b34d42..701850fe029fe 100644 --- a/packages/gatsby/src/internal-plugins/query-runner/graphql-errors.js +++ b/packages/gatsby/src/internal-plugins/query-runner/graphql-errors.js @@ -64,6 +64,7 @@ function extractError(error: Error): { message: string, docName: string } { if (matches.index === docRegex.lastIndex) docRegex.lastIndex++ ;[, message, docName] = matches } + if (!message) message = error.toString() return { message, docName } }