Comments (4)
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 electrodb
by npm, @aws-sdk/client-dynamodb
is included by its dependency.
$ npm ls @aws-sdk/client-dynamodb
[email protected] /Users/miyamonz/ghq/github.com/miyamonz/electrodb-practice
└─┬ [email protected]
└─┬ @aws-sdk/[email protected]
└── @aws-sdk/[email protected]
When yarn, yarn add electrodb
, then yarn list @aws-sdk/client-dynamodb
, nothing exists.
That's why Error: Cannot find module '@aws-sdk/client-dynamodb'
happens.
You can easily reproduce this by this:
- install aws-sdk, electrodb with yarn
- write some js file that has
new Entity
- run this code
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 think so, I would like you to consider using peerDependency.
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.
from electrodb.
Later I found this https://github.com/tywalch/electrodb/blob/master/buildbrowser.sh
you already did something about this issue.
I don't know how you deploy this as the npm library, but did something go wrong when building or deploying time?
Anyway, In the node_modules/electrodb
of my project, the line exists here.
from electrodb.
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?
from electrodb.
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": {
"@aws-sdk/client-dynamodb": "^3.245.0",
"electrodb": "^2.3.5"
}
const { DynamoDBClient } = require('@aws-sdk/client-dynamodb');
const client = new DynamoDBClient({
region: "us-east-1"
});
...
}, { client, table });
from electrodb.
Related Issues (20)
- Support readonly attributes for rebuilding a composite sort key HOT 7
- Computed attributes ignore `field` property during update HOT 4
- Secondary index keys not updated when using composite attributes from table's primary index HOT 13
- RFC: Add support for namespacing partitions HOT 7
- Setting initial value for attribute AND performing ADD operation within single `update` call on an Entity object HOT 4
- Feature request: Add Conditional Indexing Based on Attribute Presence HOT 2
- Missing `add` Method in Upsert for Transactional Writes HOT 2
- Table in Section "Attribute Options" malformed HOT 1
- Numeric sort key being ignored when building query params on a query operation. HOT 1
- Feature Request: BatchWrite across entities HOT 2
- UpdateExpression created by `.patch` doesn't account for custom attribute `field` value HOT 3
- ExpressionAttributeNames/Values can include hyphens HOT 5
- Modeling single-partition data HOT 2
- ElectroDB playground: After Page Load, the caret in code-editor is not aligned with the letters sometimes
- Specifying `response: 'all_new'` on `.update()` returns `Partial<T>` instead of `T` HOT 2
- Broken link in docs (Pagination) HOT 2
- Improve schema type using const type parameters
- Removing attributes with upsert HOT 9
- Invalid params generated for patch/update where table/GSI specified with Composite Attribute Templates HOT 1
- Typescript Warning when Omitting Non Required Attributes on Create/ Put HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from electrodb.