node-cloudflare icon indicating copy to clipboard operation
node-cloudflare copied to clipboard

TypeError: Cannot read property 'query' of undefined when calling zoneGetAll

Open reyesvindas opened this issue 5 years ago • 4 comments

I'm using a New Relic module (https://github.com/mobilenations/newrelic_cloudflare) to extract information from CloudFlare and creating a NR dashboard with that information, and the module is failing when calling the function zoneGetAll() with the following error messages:

TypeError: Cannot read property 'query' of undefined at instance._tryRequest (/home/node/app/node_modules/cloudflare4/index.js:91:38) at /home/node/app/node_modules/cloudflare4/index.js:172:30 at tryCatcher (/home/node/app/node_modules/bluebird/js/main/util.js:26:23) at Promise._settlePromiseFromHandler (/home/node/app/node_modules/bluebird/js/main/promise.js:510:31) at Promise._settlePromiseAt (/home/node/app/node_modules/bluebird/js/main/promise.js:584:18) at Promise._settlePromiseAtPostResolution (/home/node/app/node_modules/bluebird/js/main/promise.js:248:10) at Async._drainQueue (/home/node/app/node_modules/bluebird/js/main/async.js:128:12) at Async._drainQueues (/home/node/app/node_modules/bluebird/js/main/async.js:133:10) at Immediate.Async.drainQueues [as _onImmediate] (/home/node/app/node_modules/bluebird/js/main/async.js:15:14) at runCallback (timers.js:705:18) at tryOnImmediate (timers.js:676:5) at processImmediate (timers.js:658:5)

TypeError: error.annotate is not a function at /home/node/app/node_modules/cloudflare4/index.js:179:27 at tryCatcher (/home/node/app/node_modules/bluebird/js/main/util.js:26:23) at Promise._settlePromiseFromHandler (/home/node/app/node_modules/bluebird/js/main/promise.js:510:31) at Promise._settlePromiseAt (/home/node/app/node_modules/bluebird/js/main/promise.js:584:18) at Promise._settlePromises (/home/node/app/node_modules/bluebird/js/main/promise.js:700:14) at Async._drainQueue (/home/node/app/node_modules/bluebird/js/main/async.js:123:16) at Async._drainQueues (/home/node/app/node_modules/bluebird/js/main/async.js:133:10) at Immediate.Async.drainQueues [as _onImmediate] (/home/node/app/node_modules/bluebird/js/main/async.js:15:14) at runCallback (timers.js:705:18) at tryOnImmediate (timers.js:676:5) at processImmediate (timers.js:658:5)

reyesvindas avatar Aug 19 '19 21:08 reyesvindas

I'm having the same issue.

Same issue here

Nalem14 avatar Sep 08 '20 10:09 Nalem14

This problem happens when running with Node version above 8. It will work fine with the latest Node 8

jmontiel avatar Mar 24 '21 16:03 jmontiel

Confirmed using the latest version of Node 8 works. Thanks @jmontiel

rscheurman avatar Aug 31 '22 05:08 rscheurman