Skip to content

Typescript target esnext has Error type that conflicts with MigrationError extension #85

Open
@canadaduane

Description

@canadaduane

When compiling a project that includes postgres-migrations with target esnext configured in tsconfig.json, I get the following error:

> tsc

../node_modules/.pnpm/postgres-migrations@5.3.0/node_modules/postgres-migrations/dist/types.d.ts:50:5 - error TS2416: Property 'cause' in type 'MigrationError' is not assignable to the same property in base type 'Error'.
  Type 'string' is not assignable to type 'Error'.

50     cause?: string;
       ~~~~~

I believe the type definition of Error has changed based on this accepted language proposal: https://github.com/tc39/proposal-error-cause

Therefore, the following string type now conflicts with its base class:

public cause?: string

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