Aiven-Open / tsc-output-parser

Parses errors from tsc output to a structured JSON format
Apache License 2.0
24 stars 6 forks source link

tsc-output-parser fails for this tsc output #21

Open noqcks opened 3 months ago

noqcks commented 3 months ago
src/commands/CommandUtils.ts:70:16 - error TS2349: This expression is not callable.
  Type 'typeof import("/Users/noqcks/go/src/github.com/xeol-io/forked-repos/typeorm/node_modules/mkdirp/dist/mjs/index")' has no call signatures.

70         return mkdirp(directory)
                  ~~~~~~

src/driver/better-sqlite3/BetterSqlite3Driver.ts:190:15 - error TS2349: This expression is not callable.
  Type 'typeof import("/Users/noqcks/go/src/github.com/xeol-io/forked-repos/typeorm/node_modules/mkdirp/dist/mjs/index")' has no call signatures.

190         await mkdirp(dbPath)
                  ~~~~~~

src/driver/sqlite/SqliteDriver.ts:206:15 - error TS2349: This expression is not callable.
  Type 'typeof import("/Users/noqcks/go/src/github.com/xeol-io/forked-repos/typeorm/node_modules/mkdirp/dist/mjs/index")' has no call signatures.
206         await mkdirp(path.dirname(fullPath))
                  ~~~~~~

Found 3 errors in 3 files.

Errors  Files
     1  src/commands/CommandUtils.ts:70
     1  src/driver/better-sqlite3/BetterSqlite3Driver.ts:190
     1  src/driver/sqlite/SqliteDriver.ts:206

and the failure message is

SyntaxError: Expected "(" or [^\n,\r,(] but "\n" found.
    at peg$buildStructuredError (/Users/noqcks/.nvm/versions/node/v18.17.1/lib/node_modules/@aivenio/tsc-output-parser/dist/parser.js:293:16)
    at Object.peg$parse [as parse] (/Users/noqcks/.nvm/versions/node/v18.17.1/lib/node_modules/@aivenio/tsc-output-parser/dist/parser.js:928:15)
    at /Users/noqcks/.nvm/versions/node/v18.17.1/lib/node_modules/@aivenio/tsc-output-parser/dist/cli.js:39:33
    at Generator.next (<anonymous>)
    at fulfilled (/Users/noqcks/.nvm/versions/node/v18.17.1/lib/node_modules/@aivenio/tsc-output-parser/dist/cli.js:6:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  expected: [
    {
      type: 'class',
      parts: [Array],
      inverted: true,
      ignoreCase: false
    },
    { type: 'literal', text: '(', ignoreCase: false }
  ],
  found: '\n',
  location: {
    start: { offset: 128, line: 1, column: 129 },
    end: { offset: 129, line: 2, column: 1 }
  }
}

tsc version 5.0.3

alexlafroscia commented 2 months ago

I managed to get around this by executing tsc with --pretty false -- while my output at first ran into the same error as this, with that flag it managed to parse everything successfully!