nol13 / fuzzball.js

Easy to use and powerful fuzzy string matching, port of fuzzywuzzy.
MIT License
516 stars 40 forks source link

Not working on Node 6.10 #3

Closed mfrye closed 6 years ago

mfrye commented 6 years ago
{ Error: socket hang up
    at TLSSocket.onHangUp (_tls_wrap.js:1124:19)
    at TLSSocket.d (/.../node_modules/fuzzball/lib/difflib.js:5:18962)
    at TLSSocket.f.emit (/.../node_modules/fuzzball/lib/difflib.js:5:18023)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9) code: 'ECONNRESET' }

Any idea on why this isn't loading properly? I have to use 6.10 for Lambda support...

nol13 commented 6 years ago

does using npm difflib fix this? (and is not just lambda timeout?)

nol13 commented 6 years ago

also any example code? couldn't replicate locally under 6.10.3, but have had issue with the difflib import.

really would probably rather just pull the needed pieces out of it or rewrite them and save on file size

nol13 commented 6 years ago

Ok did a bit of testing, doing some basic stuff on lambda seems ok as far as I can tell. Are you sure not running out of memory or timing out? Running on lambda was actually part of original use case for making this, so want to make sure it works well.

Did go ahead and pull out just SequenceMatcher from difflib though, had kind of been on todo list for a while anyway.

mfrye commented 6 years ago

Hey sorry for the late reply. Busy week.

This was happening locally specifically on 6.10. Works fine for anything higher. Replacing with the npm library fixed it for me.

Nothing to do with Lambda. Only reason to mention Lambda is that we're limited to what node version it supports.

nol13 commented 6 years ago

Ya I'm impatient I guess. ;) Still happens with 1.1.1?

Original change I did to get it working with react-native packager was taking the dist/difflib-browser.js file from difflib and adding a module.exports to it, then swapping it in place of the standard npm require. Hacky but seemed to work, but I guess not that surprising in hindsight if it caused issues. Hoping new cut-down version better, but if not def would like to figure out whats up. Would prefer not to go back to npm version that I know breaks stuff though. (even if issue was really with metro bundler)