Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

TypeError: Cannot read properties of undefined (reading 'length') using ardb 1.1.9 #12

Closed
luckyr13 opened this issue Feb 16, 2022 · 7 comments · Fixed by #13
Closed

Comments

@luckyr13
Copy link

Hello folks! Today I updated my libraries and ardb and I'm getting the next error using the latest ardb version (1.1.9):

TypeError: Cannot read properties of undefined (reading 'length')

This happens only when trying to search using the tags method. My query is this:

 this._ardb.search('transactions')
        .limit(limit)
        .from(owners)
        .max(maxHeight)
        .tags(tags).find().then((res: ArdbTransaction[]|ArdbBlock[]) => {
          subscriber.next(res);
          subscriber.complete();
        })
        .catch((error) => {
          subscriber.error(error);
        });

It used to work before the update. Maybe the problem can be inside the tags function on this line: https://github.com/textury/ardb/blob/main/src/ardb.ts#L157

I notice that if you compare against the tag function, the following part is missing:

    if (!this.options.tags) {
      this.options.tags = [];
    }

What do you think? Thanks in advance!

@luckyr13
Copy link
Author

the problem seems to be in my code, hahaha sorry!

@luckyr13
Copy link
Author

the problem is not on my side, I doble checked!

@fuadop
Copy link
Contributor

fuadop commented Feb 17, 2022

Hey @luckyr13 a new version has been released containing this fix.

@luckyr13
Copy link
Author

Hey @luckyr13 a new version has been released containing this fix.

thank you guys, you rock!!

@luckyr13
Copy link
Author

Hey @luckyr13 a new version has been released containing this fix.

Hello @fuadop ! it seems that the node repository is not up to date with the latest version (1.1.10): https://www.npmjs.com/package/ardb

Thanks in advance for your time :)

@fuadop fuadop reopened this Feb 20, 2022
@fuadop
Copy link
Contributor

fuadop commented Feb 20, 2022

Hey @luckyr13 👋,

Thanks for noticing this 🚀. Can you try now, it has been updated already 🙂. Sorry for the inconvenience.

Best regards

@fuadop fuadop closed this as completed Feb 20, 2022
@luckyr13
Copy link
Author

it's perfect now, thanks for the fast reply, amazing!!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants