senecajs / seneca-amqp-transport

Official AMQP transport plugin for Seneca
MIT License
68 stars 25 forks source link

TypeError: Cannot read property 'pattern' of undefined #143

Open elnewfie opened 5 years ago

elnewfie commented 5 years ago

It looks like there was a breaking change in Seneca 3.14.0 that breaks the AMQP transport with the titular error. Using the following example with seneca-amqp-transport:2.2.0 and seneca:3.14.0 (or above):

const seneca = require("seneca")(),
  cfg = {
        pin:"role:<servicename>",
        type:"amqp",
        url:"...<url>",
        socketOptions: {
            ca: new Buffer([...<data>])
        }
    },
    client = seneca.use("seneca-amqp-transport")
        .client(cfg);

client.act({
            role: "...<servicename>",
            version: "v0",
            action: "...<action>"
        }, callback...);

I will get the error: TypeError: Cannot read property 'pattern' of undefined in lib/client/client-util.js:44.

If I run with a version of SenecaJS below this (for example 3.13.3) it works as advertised.

elixiao commented 4 years ago

+1, any update on this?

{
  "notice": "seneca: Action module:* failed: Cannot read property 'pattern' of undefined.",
  "code": "act_execute",
  "err": {
    "eraro": true,
    "orig": {},
    "code": "act_execute",
    "seneca": true,
    "package": "seneca",
    "msg": "seneca: Action module:* failed: Cannot read property 'pattern' of undefined.",
    "details": {
      "message": "Cannot read property 'pattern' of undefined",
      "pattern": "module:*",
      "instance": "Seneca/m624jki26b94/1578068151999/30928/3.17.0/-",
      "orig$": {},
      "message$": "Cannot read property 'pattern' of undefined",
      "plugin": {}
    },
    "callpoint": "at Object.resolveClientTopic (/Users/xxx/node_modules/seneca-amqp-transport/lib/client/client-util.js:44:34)"
  },
}
rjrodger commented 4 years ago

Using Seneca({legacy:{meta:true}}) may be a workaround.