Can't compile typescript with @aws-sdk/credential-provider-web-identity
See original GitHub issueDescribe the bug
TypeScript cannot transpile @aws-sdk/credential-provider-web-identity
due to TS1005 and TS1160 compiler errors.
The @aws-sdk/credential-provider-web-identity
was added transitively through @aws-sdk/credential-provider-node
.
Your environment
macOS
SDK version number
@aws-sdk/credential-provider-web-identity@3.38.0
@aws-sdk/credential-provider-node@3.38.0
Is the issue in the browser/Node.js/ReactNative?
Node.js
Details of the browser/Node.js/ReactNative version
v16.3.0
Steps to reproduce
- Add @aws-sdk/credential-provider-node to your project, transitively adding the offending module.
- Configure the project for typescript compilation using the tsconfig.json below.
- Run
tsc
.
Observed behavior
The compiler throws an error:
node_modules/@aws-sdk/credential-provider-web-identity/dist-types/ts3.4/fromWebToken.d.ts:21:19 - error TS1005: ']' expected.
21 [K in keyof T as `${Uncapitalize<string & K>}`]: T[K];
~~
node_modules/@aws-sdk/credential-provider-web-identity/dist-types/ts3.4/fromWebToken.d.ts:21:49 - error TS1005: '(' expected.
21 [K in keyof T as `${Uncapitalize<string & K>}`]: T[K];
~
node_modules/@aws-sdk/credential-provider-web-identity/dist-types/ts3.4/fromWebToken.d.ts:31:1 - error TS1160: Unterminated template literal.
31
Expected behavior
Compilation succeeds.
Screenshots
Additional context
tsconfig.json
{
"compilerOptions": {
"target": "ES2018",
"module": "commonjs",
"lib": [
"es2018"
],
"importHelpers": true,
"removeComments": true,
"declaration": true,
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"noImplicitThis": true,
"alwaysStrict": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": false,
"inlineSourceMap": true,
"inlineSources": true,
"experimentalDecorators": true,
"strictPropertyInitialization": false,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"noEmit": false,
"rootDir": "src",
"outDir": "dist"
},
"exclude": [
"node_modules/*"
]
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:6
Top Results From Across the Web
Module @aws-sdk/credential-provider-web-identity
Documentation for AWS SDK for JavaScript v3.
Read more >@aws-sdk/credential-provider-web-identity - npm
Start using @aws-sdk/credential-provider-web-identity in your project by ... TypeScript icon, indicating that this package has built-in type ...
Read more >vitesse vue3 issue adding libraries - typescript - Stack Overflow
I'm trying to add some dependencies to vitesse with vue 3 and typescript. I added a couple of libraries ...
Read more >Using AWS JavaScript SDK v3 in Browsers - Yiren Zhou
In this article, I will walkthrough the process of incorporating the “new” AWS JavaScript SDK in a web application, particularly how to use ......
Read more >Building a serverless app with TypeScript - LogRocket Blog
Build a serverless application using TypeScript and the serverless framework, an open source CLI and hosted dashboard.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Best solution is to move to typescript@^4, if you cannot for some reason (e.g. project limitations), lucasfloriani created a nice patch in https://github.com/aws/aws-sdk-js-v3/pull/3121
@vudh1 any workaround for this until it is fixed ?