Skip to content

Commit

Permalink
fix(gatsby-cli): relax error location validation and ignore extra fields
Browse files Browse the repository at this point in the history
  • Loading branch information
pieh committed Jan 21, 2022
1 parent 135e080 commit 0586b2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/gatsby-cli/src/structured-errors/error-schema.ts
Expand Up @@ -27,7 +27,7 @@ export const errorSchema: Joi.ObjectSchema<IStructuredError> =
location: Joi.object({
start: Position.required(),
end: Position,
}),
}).unknown(),
docsUrl: Joi.string().uri({
allowRelative: false,
relativeOnly: false,
Expand Down
5 changes: 4 additions & 1 deletion packages/gatsby/src/utils/webpack-error-utils.ts
Expand Up @@ -64,7 +64,10 @@ const transformWebpackError = (

if (!location && castedWebpackError.error?.loc) {
if (castedWebpackError.error.loc.start) {
location = castedWebpackError.error.loc
location = {
start: castedWebpackError.error.loc.start,
end: castedWebpackError.error.loc.end,
}
} else {
location = {
start: castedWebpackError.error.loc,
Expand Down

0 comments on commit 0586b2d

Please sign in to comment.