Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Raising Awareness: Sample code on main doesn't work with latest releaseΒ #477

@frmrm

Description

@frmrm

🚨 🚨 Hey folks, I'm mostly creating this to raise awareness because I wasted a good bit of time on it. 🚨 🚨

The current sample code documentation on the main README doesn't work with the most recently released version (2.6.2). Folks using this library should ensure they're looking at the readme on the release tag.

In particular, the sample code provided on main for DynamoDB v3 doesn't work in 2.6.2. You'll need to do the following:

import {Dynamo} from 'dynamodb-onetable/Dynamo'
import {Model, Table} from 'dynamodb-onetable'
import {DynamoDBClient} from '@aws-sdk/client-dynamodb'
const client = new Dynamo({client: new DynamoDBClient(params)})

When you do not do this you'll get an error that looks a lot like this:

OneTableError: OneTable execute failed "scan" for "Model", client[DocumentClientMethods[op]](...).promise is not a function

Once again, mostly opening this so other folks can discover they're making this mistake because I wasted a decent amount of time debugging it before I realized that even though the code had been on main since April 30 there had not been a new feature release since then.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions