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

[v1.0.4] TypeError: Cannot convert undefined or null to object #107

Closed
blahah opened this issue Jun 29, 2017 · 7 comments
Closed

[v1.0.4] TypeError: Cannot convert undefined or null to object #107

blahah opened this issue Jun 29, 2017 · 7 comments

Comments

@blahah
Copy link
Member

blahah commented Jun 29, 2017

https://sentry.io/codeforscience/sciencefair/issues/302489702/

TypeError: Cannot convert undefined or null to object
  at Function.keys (<anonymous>)
  at DBEntries._transform (/Applications/ScienceFair.app/Contents/Resources/app.asar/node_modules/search-index-adder/lib/delete.js:70:27)
  at dispatchError (/Applications/ScienceFair.app/Contents/Resources/app.asar/node_modules/levelup/lib/util.js:25:35)

cc @fergiemcdowall

@blahah
Copy link
Member Author

blahah commented Jun 29, 2017

@fergiemcdowall I've started seeing this a lot since upgrading search-index to the latest version. Have you seen it before?

@fergiemcdowall
Copy link

Ah yes- I made a small API change to search-index@0.13.0. Since search-index is still in beta (0.x.x), these breaking changes dont get a major version bump- on reflection, maybe its time that they did.

Anyway, long story short- when adding docs you now use feed:

fs.createReadStream('data.json')            // <- from a file
  .pipe(myIndex.feed())
  .on('finish', function() {  /* done */ })

or

myReadStream                                // <- a readable stream of objects
  .pipe(myIndex.feed({ objectMode: true }))
  .on('finish', function() {  /* done */ })

(The old .defaultPipeline -> .add will still work if you set objectMode in the options of .defaultPipeline)

@blahah
Copy link
Member Author

blahah commented Jun 29, 2017

@fergiemcdowall aha! Thanks for the explanation and I'm just happy it was something simple :D

Fix incoming

@blahah
Copy link
Member Author

blahah commented Jun 29, 2017

@fergiemcdowall does this only apply to adding? in particular, is the del API the same?

@fergiemcdowall
Copy link

.del should be unchanged.

@blahah
Copy link
Member Author

blahah commented Jun 29, 2017

Fixed in blahah/yunodb@0fcdb81

This also fixes #104 and #112

@blahah blahah closed this as completed Jun 29, 2017
@blahah
Copy link
Member Author

blahah commented Jul 1, 2017

still happening in v1.0.5 - issue is somewhere in the del method of search-index.

for now, working around this by updating only the document in yunodb: blahah/yunodb@62a7cd8

@blahah blahah reopened this Jul 1, 2017
@blahah blahah closed this as completed in e3a699d Jul 1, 2017
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

2 participants