-
Notifications
You must be signed in to change notification settings - Fork 71
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 module '@aws-sdk/client-dynamodb'
with v2 sdk
#196
Comments
Later I found this https://github.com/tywalch/electrodb/blob/master/buildbrowser.sh I don't know how you deploy this as the npm library, but did something go wrong when building or deploying time? |
I'll explore ways to bring this in conditionally. That said, you mentioned you have issues with both installed? Can you explain your issue there a bit more? |
I have only started exploring ElectroDB and encountered the same issue. Resolved it by only installing the v3 SDK and passed a new instance of DynamoDBClient as a replacement for DocumentClient without issue. "dependencies": { const { DynamoDBClient } = require('@aws-sdk/client-dynamodb'); ... |
While preparing to reproduce the environment, I found what causes this. When using npm, there is no problem, but when yarn, it happens. If you install
When yarn, You can easily reproduce this by this:
I don't know well about these differences related to dependencies. I'll check this later and add a comment if I find it. I think it's better to make this library use the AWS SDK that library users have installed themselves. If you want to ignore that method for now and run yarn as well, you might want to add @aws-sdk/client-dynamodb in the dependencies. It's an explicit dependency in this library. |
Hey @tywalch looks like this is still a problem. The problem is just about the same with pnpm. |
@tywalch boom! Works like a charm both with npm and pnpm. I believe this one can be closed! |
Thanks for the patch @tywalch 🙏 appreciate the quick turnaround |
Describe the bug
use electrodb in a project uses dynamodb v2 sdk, it shows the error.
ElectroDB Version
2.3.3
Entity/Service Definitions
It seems it's not related to this issue, but just in case.
Expected behavior
it should work with v2 client without installing v3 client.
BTW, installing v3 though I don't use it in my project that uses v2, then the error disappeared, of course,
but importing v2 and v3 causes a type error, so It would be helpful if you could address this issue.
Additional context
electrodb/src/client.js
Line 1 in 95187d3
I think this line is the problem. it imports v3 client. it should be imported dynamically.
The text was updated successfully, but these errors were encountered: