marklagendijk/node-toogoodtogo-watcher

Cannot read properties of undefined (reading 'minor_units')

Opened this issue ยท 2 comments

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

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

Got it working, posted the resolution in #248