Skip to content

Commit

Permalink
feat: include line and column in error format (#10529)
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat authored Oct 20, 2022
1 parent 67e7bf2 commit d806c4a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vite/src/node/server/middlewares/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export function buildErrorMessage(
includeStack = true
): string {
if (err.plugin) args.push(` Plugin: ${colors.magenta(err.plugin)}`)
if (err.id) args.push(` File: ${colors.cyan(err.id)}`)
const loc = err.loc ? `:${err.loc.line}:${err.loc.column}` : ''
if (err.id) args.push(` File: ${colors.cyan(err.id)}${loc}`)
if (err.frame) args.push(colors.yellow(pad(err.frame)))
if (includeStack && err.stack) args.push(pad(cleanStack(err.stack)))
return args.join('\n')
Expand Down

0 comments on commit d806c4a

Please sign in to comment.