I'm trying to subscribe a listener to NATS streaming server to communicate two NodeJS pods in Kubernetes, but NATS prompts the following error:
[be-contact-form] /usr/src/app/node_modules/nats/lib/nats.js:1672
[be-contact-form] callback(err)
[be-contact-form] ^
[be-contact-form] TypeError: Cannot read properties of undefined (reading 'emit')
[be-contact-form] at /usr/src/app/node_modules/node-nats-streaming/lib/stan.js:884:11
[be-contact-form] at Client.throwOrEmit (/usr/src/app/node_modules/nats/lib/nats.js:1672:5)
[be-contact-form] at Client.handledClosedOrDraining (/usr/src/app/node_modules/nats/lib/nats.js:1595:17)
[be-contact-form] at Client.subscribe (/usr/src/app/node_modules/nats/lib/nats.js:1727:12)
[be-contact-form] at Stan.subscribe (/usr/src/app/node_modules/node-nats-streaming/lib/stan.js:674:29)
[be-contact-form] at AuthVerifyListener.Listener.listen (/usr/src/app/node_modules/@paginas/common/build/events/base-listener.js:20:40)
[be-contact-form] at /usr/src/app/src/middlewares/current-user.ts:54:6
[be-contact-form] at Generator.next (<anonymous>)
[be-contact-form] at /usr/src/app/src/middlewares/current-user.ts:8:71
[be-contact-form] at new Promise (<anonymous>)