serverless-plugins icon indicating copy to clipboard operation
serverless-plugins copied to clipboard

dynamodb offline streams - this._waitFor is not a function

Open rcoundon opened this issue 3 years ago • 4 comments

When the _describeTable method throws an error, the catch block references this._waitFor() which isn't a function Line 58 in dynamodb-streams.js

  async _describeTable(tableName) {
    try {
      await this.client.waitFor('tableExists', {TableName: tableName}).promise();
      return await this.client
        .describeTable({
          TableName: tableName
        })
        .promise();
    } catch (err) {
      return this._waitFor(tableName);
    }

Maybe this should be:

  async _describeTable(tableName) {
    try {
      await this.client.waitFor('tableExists', {TableName: tableName}).promise();
      return await this.client
        .describeTable({
          TableName: tableName
        })
        .promise();
    } catch (err) {
      return this.client.waitFor(tableName);
    }
  }

rcoundon avatar Sep 10 '20 17:09 rcoundon

Hello @rcoundon, a fix as been released via #148, you can try ~[email protected]~ [email protected]

Please tell me if it solves the issue for you

AdrieanKhisbe avatar Sep 23 '20 09:09 AdrieanKhisbe

Thanks @AdrieanKhisbe - I'll give this a go in the next day or two when I'm back in front my computer. Does this mean I also need the serverless-offline-kinesis plugn in addition to serverless-offline-dynamodb-streams ?

rcoundon avatar Sep 23 '20 09:09 rcoundon

@rcoundon take your time :)

No it's just they had both the same issue, and I mixed things up in my message. :facepalm:

No need to kinesis, Just bump serverless-offline-dynamodb-streams, v4.2.0 also :)

AdrieanKhisbe avatar Sep 23 '20 10:09 AdrieanKhisbe

@rcoundon take your time :)

No it's just they had both the same issue, and I mixed things up in my message. 🤦

No need to kinesis, Just bump serverless-offline-dynamodb-streams, v4.2.0 also :)

Ah - brilliant - thanks!

rcoundon avatar Sep 23 '20 10:09 rcoundon