Skip to content

UnhandledPromiseRejectionWarning: TypeError: (e || "").replace is not a function #21

@MarkLyck

Description

@MarkLyck

I'm able to use this typescript-error-reporter-action fine on one of my create-react-app projects.

I just added the exact same workflow file to another project of mine based on next.js and the next.js one gets the following error:

Run andoshin11/[email protected]
Loaded [email protected] from CDN.
(node:2827) UnhandledPromiseRejectionWarning: TypeError: (e || "").replace is not a function
    at /home/runner/work/_actions/andoshin11/typescript-error-reporter-action/v1.0.2/dist/index.js:16:2442770
    at o.toString (/home/runner/work/_actions/andoshin11/typescript-error-reporter-action/v1.0.2/dist/index.js:16:2442832)
    at i (/home/runner/work/_actions/andoshin11/typescript-error-reporter-action/v1.0.2/dist/index.js:16:2442199)
    at Object.n.issue (/home/runner/work/_actions/andoshin11/typescript-error-reporter-action/v1.0.2/dist/index.js:16:2442259)
    at l (/home/runner/work/_actions/andoshin11/typescript-error-reporter-action/v1.0.2/dist/index.js:16:4067317)
    at Object.n.setFailed (/home/runner/work/_actions/andoshin11/typescript-error-reporter-action/v1.0.2/dist/index.js:16:4068058)
    at /home/runner/work/_actions/andoshin11/typescript-error-reporter-action/v1.0.2/dist/index.js:16:4043297
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:2827) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2827) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

My workflow file:

name: Typescript

on: [push]

jobs:
  typecheck:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [12.x]
    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v2
        with:
          node-version: ${{ matrix.node-version }}
      - name: Restore node_modules cache
        uses: actions/cache@v2
        with:
          path: '**/node_modules'
          key: node_modules-${{ hashFiles('**/yarn.lock') }}
      - name: Install dependencies
        run: yarn install --frozen-lockfile
      - name: Typecheck
        uses: andoshin11/[email protected]

My project builds fine, and running yarn tsc finds no errors.

My Typescript version on both projects are 4.1.5 (exact)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions