node-cloudflare
node-cloudflare copied to clipboard
TypeError: Cannot read property 'query' of undefined when calling zoneGetAll
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)
I'm having the same issue.
Same issue here
This problem happens when running with Node version above 8. It will work fine with the latest Node 8
Confirmed using the latest version of Node 8 works. Thanks @jmontiel