Cannot read property 'offset' of undefined

Topic Labels: API
2469 0
Showing results for 
Search instead for 
Did you mean: 
4 - Data Explorer
4 - Data Explorer

I am trying to load all rows of a base. The code I use is:

const airbase = airtable.base('XXXXXXXX').table('someTable')
await{offset: 0}).eachPage((records, processNextPage) => {
  records.forEach(record => console.log(record.get('someField')))

I get this error below after 3 records have been printed on the console. I tried to add query parameters (maxRecords: 1000, pageSize: 100), but the result is always the same: 3 records are printed.
When I set the pageSize to 1 I see that three records are printed as well (multiple pages are loaded, I assume), before it crashes with the same error.

    at /project/node_modules/airtable/lib/query.js:109:28
    at /project/node_modules/airtable/lib/run_action.js:70:17
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:58112) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

See excerpt from my yarn.lock

  version "0.10.0"
  resolved ""
  integrity sha512-6gBUG+z1kqvwyHYWlc+y74TfYpc18mvmNuVcefjlvd6MSgLP9Hk47ByyBS6Ke8zdSk6kBTDpdiwCjoJQUpu6yg==
    "@types/node" "^14.0.14"
    abort-controller "^3.0.0"
    abortcontroller-polyfill "^1.4.0"
    lodash "4.17.19"
    node-fetch "^2.6.0"

Thanks in advance,
Best regards

0 Replies 0