marklagendijk / node-toogoodtogo-watcher

Node.js cli tool for monitoring your favorite TooGoodToGo businesses. Docker image available.
MIT License
363 stars 116 forks source link

Cannot read properties of undefined (reading 'minor_units') #246

Open jfadeuilhe opened 9 months ago

jfadeuilhe commented 9 months ago

New problem, thank you tgtg? 😕

file:///usr/local/lib/node_modules/toogoodtogo-watcher/lib/notifications/message-renderer.js:28 💰 ${business.item.price_including_taxes.minor_units / 100} ^ TypeError: Cannot read properties of undefined (reading 'minor_units') at file:///usr/local/lib/node_modules/toogoodtogo-watcher/lib/notifications/message-renderer.js:28:42 at Array.map (<anonymous>) at renderHtmlMessage (file:///usr/local/lib/node_modules/toogoodtogo-watcher/lib/notifications/message-renderer.js:23:6) at renderMessageByFormats (file:///usr/local/lib/node_modules/toogoodtogo-watcher/lib/notifications/message-renderer.js:5:11) at notifyIfChanged (file:///usr/local/lib/node_modules/toogoodtogo-watcher/lib/notifications/notifier.js:26:28) at Object.next (file:///usr/local/lib/node_modules/toogoodtogo-watcher/index.js:61:29) at ConsumerObserver.next (/usr/local/lib/node_modules/toogoodtogo-watcher/node_modules/rxjs/dist/cjs/internal/Subscriber.js:113:33) at Subscriber._next (/usr/local/lib/node_modules/toogoodtogo-watcher/node_modules/rxjs/dist/cjs/internal/Subscriber.js:80:26) at Subscriber.next (/usr/local/lib/node_modules/toogoodtogo-watcher/node_modules/rxjs/dist/cjs/internal/Subscriber.js:51:18) at /usr/local/lib/node_modules/toogoodtogo-watcher/node_modules/rxjs/dist/cjs/internal/operators/mergeInternals.js:28:28

Node.js v18.15.0

NickXDD commented 9 months ago

Same problem here. However only shows up if there is a goodie bag available in my favourites.

NickXDD commented 8 months ago

Got it working, posted the resolution in #248