LesterCovax / crypto-sheets

Google Sheets script editor code for managing a cryptocurrency tracking spreadsheet
https://www.reddit.com/r/cryptosheets
GNU General Public License v3.0
475 stars 70 forks source link

TypeError: Cannot read property "id" from undefined. (line 134, file "Code") #39

Closed rapt-up closed 6 years ago

rapt-up commented 6 years ago

Hello, I am getting the same TypeError that another user experienced in one of the closed issues. I added more coins to myCoins list and when I hit the button to run data this message came up. Not sure how to fix it. Suggestions?

The TypeError directed me to this line of code:

while (coins[n]['id'] !== myCoins[i]) {

which is line 100 in your crypto-sheets/scripteditor.js

Thank you!

ddarbs commented 6 years ago

Can you copy your entire script to a pastebin and link it here please? I would guess that one of the coins isn't formatted correctly.

How it should be: 'bitcoin',

How you might have it: 'bitcoin'

rapt-up commented 6 years ago

https://pastebin.com/4xC9qpUp

rapt-up commented 6 years ago

I tried it a couple times and it still causes the same error

ddarbs commented 6 years ago

'ox' isn't a coin, are you looking for 'ox-fina'?

rapt-up commented 6 years ago
    "id": "0x", 
    "name": "0x", 
    "symbol": "ZRX", 
ddarbs commented 6 years ago

The script will pull by "id", so you would use '0x' instead of 'ox'. Let me know if that works for you.

rapt-up commented 6 years ago

Thank you so much, that was it!