pinojs / pino-elasticsearch

🌲 load pino logs into Elasticsearch
MIT License
179 stars 67 forks source link

Cannot read property 'bulk' of undefined - Error importing module pino-elasticsearch #68

Closed victorjabur closed 3 years ago

victorjabur commented 4 years ago

pino-elasticsearch version = 5.3.0 pino version: 6.7.0 node version: 8.17.0


node_modules/pino-elasticsearch/lib.js:61 const b = client.helpers.bulk({ ^

TypeError: Cannot read property 'bulk' of undefined at pinoElastic (/node_modules/pino-elasticsearch/lib.js:61:28) at Object. (/helpers/log.js:66:25) at Module._compile (module.js:653:30) at Module._compile (/node_modules/pirates/lib/index.js:99:24) at Module._extensions..js (module.js:664:10) at Object.newLoader [as .js] (/node_modules/pirates/lib/index.js:104:7) at Module.load (module.js:566:32) at tryModuleLoad (module.js:506:12) at Function.Module._load (module.js:498:3) at Module.require (module.js:597:17)

mcollina commented 4 years ago

Are your passing in a custom elasticsearch client?

cc @delvedor

igoreliasm commented 3 years ago

I think it's about node version I tried to run the cli and got the same error.

To reproduce:

Captura de Tela 2020-11-19 às 10 58 49

mcollina commented 3 years ago

Node 8 is not supported.