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

Cannot find name 'AggregateError'. #1612

Closed
martijnimhoff opened this issue Mar 11, 2024 · 5 comments
Closed

Cannot find name 'AggregateError'. #1612

martijnimhoff opened this issue Mar 11, 2024 · 5 comments

Comments

@martijnimhoff
Copy link

Software versions

  • Tedious: 18.1.0
  • @types/node: 18.19.8
  • Node.js: 18.19.1
  • Typescript: 5.3.3

Problem description
When I install this library in my project. I'm getting the following type error in the library:

> eslint .; tsc --noemit

node_modules/tedious/lib/connection.d.ts:748:29 - error TS2304: Cannot find name 'AggregateError'.

748     loginError: undefined | AggregateError | ConnectionError;
                                ~~~~~~~~~~~~~~

Found 1 error in node_modules/tedious/lib/connection.d.ts:748

Expected behavior
It looks like AggregateError should be available, but it is not found. I can't reproduce this type error when just running the linter in the library itself.

@martijnimhoff
Copy link
Author

Cause was that target in tsconfig.json was set to es2020.

@wy193777
Copy link

I have the same error, can you be detailed on how did you fixed it?

@lroal
Copy link

lroal commented May 12, 2024

How do I solve this ?
I am using pure javascript with typescript definition files.
Have no tsconfig.json

@martijnimhoff
Copy link
Author

martijnimhoff commented May 13, 2024

I have the same error, can you be detailed on how did you fixed it?

In my tsconfig.json, I changed the target to es2022.

How do I solve this ?
I am using pure javascript with typescript definition files.
Have no tsconfig.json

Are you building a library yourself? How does this setup work?

@lroal
Copy link

lroal commented May 13, 2024

target es2022 solved it

tsc ./src/index.d.ts --module commonjs --target es2022 --noEmit true --strict true --esModuleInterop true

I use tsc to check that my typescript definitions are correct:
https://github.com/alfateam/rdb/blob/master/package.json#L44

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

3 participants