➜ node index.js
file:///…/node_modules/clockodo/dist/lib/api.js:168
const remainingPages = Array.from({ length: paging.countPages - 1 }, (_, index) => index + 2);
^
TypeError: Cannot read properties of undefined (reading 'countPages')
at Api.getPagesStreaming_1 (file:///…/node_modules/clockodo/dist/lib/api.js:168:64)
at getPagesStreaming_1.next (<anonymous>)
at resume (file:///…/node_modules/clockodo/dist/lib/api.js:28:44)
at file:///…/node_modules/clockodo/dist/lib/api.js:27:121
at new Promise (<anonymous>)
at i.<computed> [as next] (file:///…/node_modules/clockodo/dist/lib/api.js:27:63)
at Api.<anonymous> (file:///…/node_modules/clockodo/dist/lib/api.js:177:97)
at Generator.next (<anonymous>)
at fulfilled (file:///…/node_modules/clockodo/dist/lib/api.js:4:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Node.js v18.14.1
I'm not really familiar with the inner workings of this SDK, I just noticed that something stopped working in my app, so I poked into it:
/v3/services
results in{ "services": […], filter: … }
yet the SDK assumes paging info? See the error below.If you change the object access to optional chaining it works:
Repro:
v23.5.1