ssb-server icon indicating copy to clipboard operation
ssb-server copied to clipboard

TypeError: Cannot set property 'module' of undefined

Open ndarilek opened this issue 4 years ago • 5 comments

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

ndarilek avatar May 27 '20 00:05 ndarilek

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 {}

stripedpajamas avatar Jul 31 '20 18:07 stripedpajamas

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

stale[bot] avatar Nov 07 '20 22:11 stale[bot]

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.

ndarilek avatar Nov 09 '20 15:11 ndarilek

@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

austinfrey avatar Jan 13 '21 16:01 austinfrey

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

stale[bot] avatar Jun 02 '21 17:06 stale[bot]