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

@aws-sdk/types 3.13.1 is not compatible with Typescript 3.x #2372

Closed
rajivshah3 opened this issue May 10, 2021 · 4 comments
Closed

@aws-sdk/types 3.13.1 is not compatible with Typescript 3.x #2372

rajivshah3 opened this issue May 10, 2021 · 4 comments
Assignees
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@rajivshah3
Copy link

Describe the bug

Basically the same issue as #2217. This line is not supported in Typescript 3.x:

export type UserAgentPair = [name: string, version?: string];

Your environment

SDK version number

@aws-sdk/[email protected]

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

Node.js

Details of the browser/Node.js/ReactNative version

node: v12.19.1
tsc: v3.9.9

Steps to reproduce

package.json:

{
  "dependencies": {
    "@aws-sdk/types": "^3.13.1"
  },
  "devDependencies": {
    "typescript": "^3.9.9"
  }
}

test.ts:

import '@aws-sdk/types'

Observed behavior

Running yarn && yarn tsc test.ts gives the following output:

node_modules/@aws-sdk/types/dist/types/util.d.ts:92:42 - error TS1005: ',' expected.

92 export declare type UserAgentPair = [name: string, version?: string];
                                            ~

node_modules/@aws-sdk/types/dist/types/util.d.ts:92:60 - error TS1005: ',' expected.

92 export declare type UserAgentPair = [name: string, version?: string];
                                                              ~


Found 2 errors.

Expected behavior

Should compile properly on Typescript 3.x

Additional context

The backwards-compatible types don't seem to exist at dist/types/ts3.4/util.d.ts or types/ts3.4/util.d.ts in 3.13.1. They do appear at dist/types/ts3.4/util.d.ts in 3.10.0, but I still get an error with that version. As mentioned in the linked issue, 3.6.1 works, but I haven't checked versions between 3.6.1 and 3.10.0. The backwards-compatible types exist for 3.6.1 exist at types/ts3.4/util.d.ts, so I wonder if that's the issue (in 3.10.0 they were in dist).

@rajivshah3 rajivshah3 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 10, 2021
@rajivshah3
Copy link
Author

I manually made the change from smithy-lang/smithy-typescript#338 in @aws-sdk/types, ran yarn pack, and then yarn add file://path/to/tarball and yarn tsc test.ts seems to work now

@richenyadav001
Copy link

richenyadav001 commented Jun 3, 2021

Same issue i am also facing
Nodejs Framework: nestjs
TS : "typescript": "^3.9.7"
AWS SDK: "@aws-sdk/client-s3": "^3.17.0"

Nest has another module for aws sdk but its in aws V2

tsconfig.json
{
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es2017",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"incremental": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true
},
"exclude": ["dist", "node_modules"]
}

@ajredniwja ajredniwja self-assigned this Jun 30, 2021
@trivikr
Copy link
Member

trivikr commented Jul 2, 2021

The issue was with internal release script.
Updates about the fix: #2474 (comment)

@trivikr trivikr closed this as completed Jul 2, 2021
elibarzilay pushed a commit to DefinitelyTyped/DefinitelyTyped that referenced this issue Jul 8, 2021
* First import of aws-synthetics-puppeteer

* Reformatted with Prettier

* Removed dependency in @types/puppeteer as per CI

* Change require to import for ESM compatibility

* Log exceptions is optional

* Rerun CI now xray is permitted by DT tools

* Fix all dtslint + ts-next issues

* Downgrade x-ray because aws-sdk-js is incompatible with Typescript 3.x
Issue: aws/aws-sdk-js-v3#2372

* Add better types on frequently used methods

* Add better types on frequently used methods

* fix: takeScreenshot is async
@github-actions
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 Jul 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

4 participants