question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: ticks is not iterable

See original GitHub issue

It looks like #162 but I’m using depthcache and all my scripts started crashing with this and I’m not sure what is I’m passing that’s causing it yet, It happens after a while, can be a couple minutes or hours or running. I did not try useServerTime: true.

Thanks, I really appreciate the library!

.../node-binance-api/node-binance-api.js:391
        for ( let tick of ticks ) {
                          ^

TypeError: ticks is not iterable

Im not calling getPricesWS more than once.


const getPricesWS = () => {
    try {
        binance.websockets.depthCache(['ETHUSDT'], (symbol, depth) => {
            const bids = binance.sortBids(depth.bids);
            const asks = binance.sortAsks(depth.asks);
            bestAsk = parseFloat(binance.first(asks));
            bestBid = parseFloat(binance.first(bids));
        });
    } catch(err) {
        errorLogs.push(err);
    }
};

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
mathlet0xcommented, Apr 6, 2018

I also have the same error when i have an unstable internet connection. So i fixed it but i don’t know if i’m doing it right so i won’t make a PR before your agreement.

I implemented this method and simply check if ticks is iterable :

    const isIterable = function(obj) {
      // checks for null and undefined
      if (obj == null) {
        return false;
      }
      return typeof obj[Symbol.iterator] === 'function';
    }

and i added this condition line 999 :

if(klineQueue[symbol][interval] !== undefined && kline !== null)

2reactions
jaggedsoftcommented, Apr 6, 2018

@mathlet0x Thank you very much for sharing!

Read more comments on GitHub >

github_iconTop Results From Across the Web

for item in data: TypeError: 'float' object is not iterable
throws an error cuz you are trying to iterate through a float value. from what i came up with, this line Clock.schedule_once(self.update, 1)...
Read more >
TypeError: 'x' is not iterable - JavaScript - MDN Web Docs
The JavaScript exception "is not iterable" occurs when the value which is given as the right-hand side of for...of , as argument of...
Read more >
Subsetting Rows from Conditions File Is Not Working - Builder
Ok so for method 1: ““for n in selection: TypeError: 'NoneType' object is not iterable”” means that you are not getting a list...
Read more >
typeerror: boolean false is not iterable (cannot read property ...
TypeError : undefined is not iterable (cannot read property Symbol(Symbol.iterator)) ... tick=418 Error at new Map () at new QuorumProposals ...
Read more >
argument of type 'NoneType' is not iterable - Can't find out why ...
TypeError : argument of type 'NoneType' is not iterable - Can't ... apparently the three back ticks to enter back into markdown didn't...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found