ssbc / ssb-links

ssb-plugin that indexes all the links!
MIT License
9 stars 8 forks source link

TypeError: Cannot read property '1' of undefined #3

Closed cryptix closed 6 years ago

cryptix commented 6 years ago

A lot of people are reporting this now, mainly in patchfoo. I hoped it was just a version fluke on my part but can't figure out what's wrong...

I tried a couple of fresh installs and they all lead to this.

TypeError: Cannot read property '1' of undefined
    at /home/sbot/scuttlebot/node_modules/flumeview-query/links.js:97:43
    at /home/sbot/scuttlebot/node_modules/pull-stream/throughs/map.js:13:23
    at /home/sbot/scuttlebot/node_modules/pull-stream/throughs/map.js:19:9
    at /home/sbot/scuttlebot/node_modules/pull-stream/throughs/filter.js:17:11
    at /home/sbot/scuttlebot/node_modules/pull-cat/index.js:35:13
    at Array.<anonymous> (/home/sbot/scuttlebot/node_modules/pull-stream/sources/once.js:10:7)
    at next (/home/sbot/scuttlebot/node_modules/pull-cat/index.js:28:19)
    at /home/sbot/scuttlebot/node_modules/pull-cat/index.js:31:30
    at drain (/home/sbot/scuttlebot/node_modules/stream-to-pull-stream/index.js:141:18)
    at ReadStream.<anonymous> (/home/sbot/scuttlebot/node_modules/stream-to-pull-stream/index.js:158:5)

I tried to dig a little into it by adding some debugging prints before the crash but I couldn't gain any insights from it. See %fpMUeEjlQYyej334V4fOcDKACeW3ZtYsGmhS/nu/iEw=.sha256.

cryptix commented 6 years ago

I still think there is a weird version 3 of this on npmjs.org but don't know if this is the cause...

$ npm i --save ssb-links@3
$ jq '.dependencies["ssb-links"]' package-lock.json
{
  "version": "3.0.0",
  "resolved": "https://registry.npmjs.org/ssb-links/-/ssb-links-3.0.0.tgz",
  "integrity": "sha1-dXr7Pro2FGPo1MtFKZHCr46lwho=",
  "requires": {
    "flumeview-query": "3.0.7",
    "map-filter-reduce": "2.2.1",
    "pull-stream": "3.6.1",
    "ssb-msgs": "5.2.0"
  }
}
$ curl https://registry.npmjs.org/ssb-links/-/ssb-links-3.0.0.tgz | tar xzf -
$ cat package/package.json 
{
  "name": "ssb-links",
  "description": "",
  "version": "3.0.0",
  "homepage": "https://github.com/dominictarr/ssb-links",
  "repository": {
    "type": "git",
    "url": "git://github.com/dominictarr/ssb-links.git"
  },
  "dependencies": {
    "flumeview-query": "^3.0.0",
    "map-filter-reduce": "^2.0.0",
    "pull-stream": "^3.1.0",
    "ssb-msgs": "^5.2.0"
  },
  "devDependencies": {},
  "scripts": {
    "test": "set -e; for t in test/*.js; do node $t; done"
  },
  "author": "Dominic Tarr <dominic.tarr@gmail.com> (http://dominictarr.com)",
  "license": "MIT"
}

AFAICT ssb-links@3 shouldn't use flumeview-query@3 but 4...!

cryptix commented 6 years ago

Cel fixed the root issue (%r5CQtdn+FuVm8nNVAeoYySEdcDalWkXXQh7QxJGain8=.sha256) but the version 3 thing is still weird.

cryptix commented 6 years ago

@dominictarr can you please take a look and maybe update this to 3.0.1 just for my sanity?

dominictarr commented 6 years ago

@cryptix sorry that is really weird. published 3.0.1 which definitely depends on flumeview-query@4

cryptix commented 6 years ago

Thanks. I guess we can close this for now than.