Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type 'ErrorWithCause' is not generic #674

Closed
GarrettEHill opened this issue May 17, 2024 · 1 comment
Closed

Type 'ErrorWithCause' is not generic #674

GarrettEHill opened this issue May 17, 2024 · 1 comment

Comments

@GarrettEHill
Copy link

Bug Description

When upgrading Node.js from version 18.19.1 to 20.12.2, a TypeScript error is thrown when attempting to compile a project that uses umzug. The TypeScript error relates to the ErrorWithCause type in the umzug.d.ts file not being generic, which causes a build failure.

Steps to Reproduce

  1. Upgrade Node.js from version 18.19.1 to 20.12.2.
  2. Use umzug in a TypeScript project with the following relevant package versions:
    • typescript: version used (e.g., 4.5.4)
    • umzug: 3.8.0
  3. Run the TypeScript compiler (tsc).

Expected Behavior

The project should compile without TypeScript errors.

Actual Behavior

The TypeScript compiler throws the following error:

node_modules/umzug/lib/umzug.d.ts:9:45 - error TS2315: Type 'ErrorWithCause' is not generic.

9 export declare class MigrationError extends errorCause.ErrorWithCause<unknown> {
                                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Possible Solution

This issue might be related to specific TypeScript version compatibilities or changes in Node.js that affect how TypeScript handles types. A temporary workaround is to set "skipLibCheck": true in the tsconfig.json to ignore the library check.

Additional Information

Here are the relevant versions from the yarn list output:

yarn list v1.22.19
warning Resolution field "axe-core@4.6.3" is incompatible with requested version "axe-core@~4.9.0"
warning Resolution field "axe-core@4.6.3" is incompatible with requested version "axe-core@=4.7.0"
warning Filtering by arguments is deprecated. Please use the pattern option instead.
├─ sequelize-cli@6.6.2
│ └─ umzug@2.3.0
└─ umzug@3.8.0
Done in 1.22s.

Request

It would be helpful to have guidance on compatibility issues or any available fixes to address this type error with newer Node.js versions.

Thank you for looking into this.

@GarrettEHill
Copy link
Author

I just needed to update typescript, not an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant