Skip to content

Unformatted errors when running pkg watch #222

@bjoerge

Description

@bjoerge

Currently, errors that may happen during doExtract when running pkg watch --strict (not sure if --strict matters) are currently logged as-is without any sort of formatting, which leads to output like this:

[error] DtsError: encountered 2 errors when extracting types
    at doExtract (./node_modules/@sanity/pkg-utils/dist/_chunks/index-c12a2784.cjs:2156:2098) {
  messages: [
    ExtractorMessage {
      category: 'Extractor',
      messageId: 'ae-forgotten-export',
      text: '(…)',
      sourceFilePath: './src/types.ts',
      sourceFileLine: 23,
      sourceFileColumn: 1,
      properties: {},
      _handled: true,
      _logLevel: 'error'
    },
    ExtractorMessage {
      category: 'Extractor',
      messageId: 'ae-forgotten-export',
      text: '(…)',
      sourceFilePath: './types.ts',
      sourceFileLine: 139,
      sourceFileColumn: 1,
      properties: {},
      _handled: true,
      _logLevel: 'error'
    }
  ]
}

ERROR: "pkg:watch" exited with 1.

Not a super big deal, but it would be nice if these errors could be formatted the same way as they are when error occurs during pkg build:

[error] 1638ms
[error] encountered 2 errors when extracting types


types.ts:23:1 - error ae-forgotten-export
(The error message)

types.ts:139:1 - error ae-forgotten-export
(The error message)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions