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

Typescript 3.5.x breaking @aws-sdk/types #2022

Closed
trivikr opened this issue Feb 11, 2021 · 5 comments
Closed

Typescript 3.5.x breaking @aws-sdk/types #2022

trivikr opened this issue Feb 11, 2021 · 5 comments
Labels
bug This issue is a bug. closed-for-staleness p3 This is a minor priority issue

Comments

@trivikr
Copy link
Member

trivikr commented Feb 11, 2021

Describe the bug

@aws-sdk/types uses AsyncGenerator

/**
* Expected type definition of a paginator.
*/
export type Paginator<T> = AsyncGenerator<T, T, unknown>;

The customer code throws "Cannot find name 'AsyncGenerator'" when trying to compile with TS <3.6.x

$ tsc
node_modules/@aws-sdk/types/types/ts3.4/pagination.d.ts:5:36 - error TS2304: Cannot find name 'AsyncGenerator'.

5 export declare type Paginator<T> = AsyncGenerator<T, T, unknown>;
                                     ~~~~~~~~~~~~~~
Found 1 error.

Your environment

SDK version number

@aws-sdk/client-s3@3.4.1

Is the issue in the browser/Node.js/ReactNative?

N/A

Details of the browser/Node.js/ReactNative version

Not relevant but, Node.js v14.15.4

Steps to reproduce

package.json
{
  "scripts": {
    "build": "tsc"
  },
  "dependencies": {
    "@aws-sdk/client-s3": "3.4.1"
  },
  "devDependencies": {
    "@types/node": "14.14.25",
    "typescript": "3.5.3"
  }
}
tsconfig.json
{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "strict": true,
    "esModuleInterop": true
  }
}
index.ts
import { S3Client } from "@aws-sdk/client-s3";

Observed behavior

yarn build
yarn run v1.22.10
warning package.json: No license field
$ tsc
node_modules/@aws-sdk/types/types/ts3.4/pagination.d.ts:5:36 - error TS2304: Cannot find name 'AsyncGenerator'.

5 export declare type Paginator<T> = AsyncGenerator<T, T, unknown>;
                                     ~~~~~~~~~~~~~~


Found 1 error.

error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Expected behavior

No error is thrown when compiling client code with TypeScript version 3.5.x

Additional context

Follow-up to #1919

@trivikr trivikr added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. and removed needs-triage This issue or PR still needs to be triaged. labels Feb 11, 2021
@trivikr
Copy link
Member Author

trivikr commented Feb 11, 2021

One workaround is to unblock is to enable skipLibCheck in TSConfig of application code.
This would skip type checking of all declaration files though.

@trivikr
Copy link
Member Author

trivikr commented Feb 11, 2021

This happens as the AsyncGenerator was added in es2018.asyncgenerator which was release in TypeScript 3.6

@github-actions
Copy link

Greetings! We’re closing this issue because it has been open a long time and hasn’t been updated in a while and may not be getting the attention it deserves. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to comment or open a new issue.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Mar 10, 2022
@trivikr trivikr removed the closing-soon This issue will automatically close in 4 days unless further comments are made. label Mar 10, 2022
@RanVaknin RanVaknin added the p3 This is a minor priority issue label Mar 3, 2023
Copy link

github-actions bot commented Mar 3, 2024

Greetings! We’re closing this issue because it has been open a long time and hasn’t been updated in a while and may not be getting the attention it deserves. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to comment or open a new issue.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Mar 3, 2024
@github-actions github-actions bot closed this as completed Mar 8, 2024
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. closed-for-staleness p3 This is a minor priority issue
Projects
None yet
Development

No branches or pull requests

2 participants