ssbc / ssb-server

The gossip and replication server for Secure Scuttlebutt - a distributed social network
1.68k stars 164 forks source link

TypeError: Cannot set property 'module' of undefined #725

Open ndarilek opened 4 years ago

ndarilek commented 4 years ago

Getting the following when attempting to instlal plugins on V19.2.0:

$ sbot plugins.install ssb-backlinks
/home/nolan/.node_modules/lib/node_modules/ssb-server/node_modules/muxrpcli/index.js:125
      throw err
      ^
TypeError: Cannot set property 'module' of undefined
    at Object.install (/home/nolan/.node_modules/lib/node_modules/ssb-server/node_modules/ssb-plugins/index.js:117:23)
    at Object.hooked (/home/nolan/.node_modules/lib/node_modules/ssb-server/node_modules/hoox/index.js:10:15)
    at Object.localCall (/home/nolan/.node_modules/lib/node_modules/ssb-server/node_modules/muxrpc/local-api.js:31:29)
    at Object.<anonymous> (/home/nolan/.node_modules/lib/node_modules/ssb-server/node_modules/muxrpc/local-api.js:37:22)
    at PacketStreamSubstream.stream.read (/home/nolan/.node_modules/lib/node_modules/ssb-server/node_modules/muxrpc/stream.js:69:23)
    at PacketStream._onstream (/home/nolan/.node_modules/lib/node_modules/ssb-server/node_modules/packet-stream/index.js:228:11)
    at PacketStream.write (/home/nolan/.node_modules/lib/node_modules/ssb-server/node_modules/packet-stream/index.js:135:41)
    at /home/nolan/.node_modules/lib/node_modules/ssb-server/node_modules/muxrpc/pull-weird.js:56:15
    at /home/nolan/.node_modules/lib/node_modules/ssb-server/node_modules/pull-stream/sinks/drain.js:24:37
    at /home/nolan/.node_modules/lib/node_modules/ssb-server/node_modules/pull-goodbye/node_modules/pull-stream/throughs/filter.js:17:11
stripedpajamas commented 4 years ago

It appears that ssb-plugins is expecting an "options" object here:

install: function (opts, _opts) {
  var pluginName
  if(isString(opts)) {
    pluginName = opts
    opts = _opts
    opts.module = pluginName
  }

I found that installing a plugin with {} after it does not through the error:

$ ssb-server plugins.install ssb-about {}
stale[bot] commented 3 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

ndarilek commented 3 years ago

I'd guess it's still relevant. The {} as command line argument syntax is a bit odd. Maybe there's a scenario where passing options on the installation command line is needed, but I think the default empty case should be handled silently.

austinfrey commented 3 years ago

@ndarilek try using the --name flag. ssb-server plugins.install --name ssb-about

see also: https://github.com/ssbc/ssb-server/issues/749 https://github.com/ssbc/ssb-server/issues/718

stale[bot] commented 3 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?