Moleculer: Transporter NATS can not connect "client.on is not a function".

Created on 2 Apr 2021  路  4Comments  路  Source: moleculerjs/moleculer

molecular: "version": "0.14.12",
"nats": "^2.0.0",

moleculer\src\transporters\nats.js

image
This throws client.on is not a function because Nats.connect return a Promise, thus need to use await .
Or am I missing something ?

Transporter Low Question

Most helpful comment

Hi @rozhddmi there's a note about nats v2 in the docs and support for it is on our ToDo list.

All 4 comments

ok it seems to be a breaking changes in NATS from version 1.14.12 -> 2.
And currently Moleculer supports 1.X.X version, probably a note in documentation or update of the nats.js to support latest version on nats package
When using nats:^1.14.12 everything works as expected

That's all right. NATS has been updated without backward support and it will take us a while to create a new transport for v2.

Hi @rozhddmi there's a note about nats v2 in the docs and support for it is on our ToDo list.

@rozhddmi please search issues before open a duplicated topic.
https://github.com/moleculerjs/moleculer/issues/893

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maitrucquynhq111 picture maitrucquynhq111  路  3Comments

DeividasJackus picture DeividasJackus  路  4Comments

icebob picture icebob  路  3Comments

darky picture darky  路  5Comments

slinkardbrandon picture slinkardbrandon  路  4Comments