seongjaelee / nvatom

nvatom (unpublished from atom.io)
MIT License
75 stars 14 forks source link

Uncaught TypeError: Cannot read property 'tf' of undefined #44

Closed OrcsBR closed 8 years ago

OrcsBR commented 8 years ago

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.3.2 System: Mac OS X 10.11.2 Thrown From: nvatom package, v0.9.3

Stack Trace

Uncaught TypeError: Cannot read property 'tf' of undefined

At /Users/orcsbr/.atom/packages/nvatom/node_modules/docquery/node_modules/lunr/lunr.js:1150

TypeError: Cannot read property 'tf' of undefined
    at [object Object].lunr.Index.documentVector (/Users/orcsbr/.atom/packages/nvatom/node_modules/docquery/node_modules/lunr/lunr.js:1150:53)
    at [object Object].<anonymous> (/Users/orcsbr/.atom/packages/nvatom/node_modules/docquery/node_modules/lunr/lunr.js:1122:61)
    at Array.map (native)
    at [object Object].lunr.SortedSet.map (/Users/orcsbr/.atom/packages/nvatom/node_modules/docquery/node_modules/lunr/lunr.js:622:24)
    at [object Object].lunr.Index.search (/Users/orcsbr/.atom/packages/nvatom/node_modules/docquery/node_modules/lunr/lunr.js:1121:6)
    at DocQuery.search (/Users/orcsbr/.atom/packages/nvatom/node_modules/docquery/lib/DocQuery.js:119:31)
    at NotationalVelocityView.module.exports.NotationalVelocityView.filter (/Users/orcsbr/.atom/packages/nvatom/lib/notational-velocity-view.coffee:67:22)
    at NotationalVelocityView.module.exports.NotationalVelocityView.populateList (/Users/orcsbr/.atom/packages/nvatom/lib/notational-velocity-view.coffee:141:22)
    at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:350:26

Commands

     -0:47.2.0 application:add-project-folder (atom-text-editor.editor.is-focused)
     -0:01.3.0 nvatom:toggle (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "solarized-dark-syntax"
    ]
  },
  "nvatom": {
    "directory": "/Users/orcsbr/Dropbox/TextDB/",
    "enableLunrPipeline": false,
    "extensions": [
      ".txt",
      ".md"
    ]
  }
}

Installed Packages

# User
nvatom, v0.9.3
pandoc-convert, v1.0.4

# Dev
No dev packages
seongjaelee commented 8 years ago

I fixed that bug on lunr. https://github.com/olivernn/lunr.js/pull/177 It is merged 0.6.0 (2015-10-26). I do not see this error at this point (2016-04-22).

If we still see the error, please let me know. I guess we need to update docquery's min. lunr version to 0.6.0?

seongjaelee commented 8 years ago

Hmm, I uninstall/reinstalled nvatom, and it does not happen anymore. The weird thing is that, its docquery's lunr's version is still 5.0.12. How this can happen...?

-> It turns out I manually modified lunr's code locally.

seongjaelee commented 8 years ago

https://github.com/jonmagic/docquery/pull/9

seongjaelee commented 8 years ago

https://github.com/seongjaelee/nvatom/commit/aa641ba69575cea4ff3489e09446a274e880a4b4