Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
elnewfie opened this issue Nov 4, 2019 · 2 comments
Open

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

elnewfie opened this issue Nov 4, 2019 · 2 comments

Comments

@elnewfie
Copy link

elnewfie commented Nov 4, 2019

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
Copy link

elixiao commented Jan 3, 2020

+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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants