-
Notifications
You must be signed in to change notification settings - Fork 580
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
Error Module has no exported member 'UserAgent' while using aws-sdk-js-v3 #1842
Error Module has no exported member 'UserAgent' while using aws-sdk-js-v3 #1842
Comments
I am running into this error as well. I'm using I see it with a few other clients as well
What appears to be going is that all three of these clients have a dependencies on
I'm using yarn and when I grep through my It looks like this was probably introduced in #1775 It looks like this would be fixed by aws/aws-sdk-js-crypto-helpers#187 Adding this to my "resolutions": {
"@aws-sdk/types": "^3.1.0"
} |
Using the the above temporary work-around I have to explicitly install npm install -D @aws-sdk/[email protected] |
Installing @aws-sdk/types as above made this error go away, but then I got another error:
I guess that package doesn't work with strict mode enabled. |
I am also getting same issue.Looking for any solution. |
Hey everyone, I just wanted to let you know that the following seems to fix this issue:
I hope this is useful. |
@olokobayusuf thanks your solution worked for me. |
I am also getting the same error as @prime417 after explicitly installing types. As I am using angular 9.1.12 which uses typescript version 3.8.3, as soon as I switched to 4.1.3, I am getting this error. In order to have this hack work for me I need to upgrade the angular version to 10.1.0 or above. Compiling TypeScript sources through ngc
ERROR: The Angular Compiler requires TypeScript >=3.6.4 and <3.9.0 but 4.1.3 was found instead.
An unhandled exception occurred: The Angular Compiler requires TypeScript >=3.6.4 and <3.9.0 but 4.1.3 was found instead. waiting for it to be resolved and any other suggestions? |
@olokobayusuf your solution has also worked for me. Thank you |
Thanks everyone for the thorough investigation. @olokobayusuf 's solution should solve the problem. Although the |
Hey there @AllanZhengYP I hate to discuss a different issue, but my development is completely blocked on #1857 . I don't mind making a custom fork of the SDK with a fix while you all work on an official update, but I need a fix ASAP. |
This isn't working for me with the EC2 Client, after applying @olokobayusuf solution I'm getting the following:
|
@olokobayusuf You can also post a PR with a fix on this repo. |
Check your Typescript version. You're likely getting this error because you're running on TS 3.x. |
That's fine by me, I just need to know how to fix it. I haven't done too much static analysis on the codebase because I haven't had the time. I'm unfamiliar with the middleware stack, but I'm guessing any fix would be either working around the middleware stack, or making the keys within the stack unique so that the conflict never pops up (this would be harder because there isn't a global state for knowing how many requests are in flight AFAIK, so I'd have to resort to something hacky like appending a UUID to the key for each entry). I just need a quick rundown and I'll try to hash it out as quickly as possible. |
This issue is happening as
$ yarn why @aws-sdk/types
yarn why v1.22.10
warning package.json: No license field
[1/4] 🤔 Why do we have the module "@aws-sdk/types"...?
[2/4] 🚚 Initialising dependency graph...
warning No license field
[3/4] 🔍 Finding dependency...
[4/4] 🚡 Calculating file sizes...
=> Found "@aws-sdk/[email protected]"
info Has been hoisted to "@aws-sdk/types"
info Reasons this module exists
- Hoisted from "@aws-sdk#client-s3#@aws-crypto#sha256-browser#@aws-sdk#types"
- Hoisted from "@aws-sdk#client-s3#@aws-crypto#sha256-js#@aws-sdk#types"
info Disk size without dependencies: "524KB"
info Disk size with unique dependencies: "524KB"
info Disk size with transitive dependencies: "524KB"
info Number of shared dependencies: 0
=> Found "@aws-sdk/util-user-agent-browser#@aws-sdk/[email protected]"
info This module exists because "@aws-sdk#client-s3#@aws-sdk#util-user-agent-browser" depends on it.
info Disk size without dependencies: "540KB"
info Disk size with unique dependencies: "540KB"
info Disk size with transitive dependencies: "540KB"
info Number of shared dependencies: 0
=> Found "@aws-sdk/util-user-agent-node#@aws-sdk/[email protected]"
info This module exists because "@aws-sdk#client-s3#@aws-sdk#util-user-agent-node" depends on it.
info Disk size without dependencies: "540KB"
info Disk size with unique dependencies: "540KB"
info Disk size with transitive dependencies: "540KB"
info Number of shared dependencies: 0
✨ Done in 0.16s. ToDo: Move |
node_modules/@aws-sdk/types/dist/cjs/util.d.ts:92:42 - error TS1005: ',' expected. 92 export declare type UserAgentPair = [name: string, version?: string]; node_modules/@aws-sdk/types/dist/cjs/util.d.ts:92:60 - error TS1005: ',' expected. 92 export declare type UserAgentPair = [name: string, version?: string]; |
Still seeing this bug with yesterday's release of the SDK, Since a couple PR's were merged in over in https://github.com/aws/aws-sdk-js-crypto-helpers, I think this is now just blocked on a new release of the various packages from that repo. /cc @seebees |
The next version of crypto-helpers is expected to release on Wed 1/13. We'll release JS SDK v3 |
Posting this here for documentation and visibility. TLDR: After some investigation we've come to the conclusion that Background Like @olokobayusuf mentioned including Why are we doing this? Wont this increase node module size?
The AWS SDK team (and I personally) agree. Additionally most JS users use bundlers anyway that should strip out these files. |
This should be going out with our next release. Huge shout out to @olokobayusuf! |
@alexforsyth glad to see this fixed! Is it worth reviewing how this got through testing? This feels to me like the sort of thing that would be caught in CICD etc. before ever shipping. |
@MarrickLip We're working on it, I dont have anything I can post to the public quite yet |
@alexforsyth just to confirm, the new release is also supposed to fix the already reported issue about this
Just checking if it needs another issue to be fixed. I'm currently hitting this when using explicit dependency to |
@markusl yes it should be fixed. If you run
In the next version there will be no dependencies on |
As of yesterday's |
Hi, still having issues... I still see after upgrade to v3.3.0:
|
@adaadamczak007 please upgrade to typescript ^4.0.0. This issue is slightly different and tracked here: #1919. TS doesn’t have LTS concept, they drop support for previous version when the new one is released. I'll post updates when I can make more public, we're working on guidance around this internally! |
Closing this bug as |
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. |
Describe the bug
I am using aws-sdk-js-v3 in my typescript project, I installed package with command
yarn add @aws-sdk/client-s3
.After using S3Client in my typescript code
Application starts failing with error
SDK version number
3.1.0
Is the issue in the browser/Node.js/ReactNative?
Node.js
Details of the Node.js version
$ node -v
v12.4.0
To Reproduce (observed behavior)
yarn add @aws-sdk/client-s3
yarn run start:Dev
Note:
If I install package @aws-sdk/types with command
yarn add @aws-sdk/types
then this error goes away and works as expected.Do we really need @aws-sdk/types package, Expectation was @aws-sdk/client-s3 will be sufficient.
Expected behavior
It should not give any error and extra package @aws-sdk/types should not be needed
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: