node-unfluff icon indicating copy to clipboard operation
node-unfluff copied to clipboard

ENOENT exception trying to open stopwords-en.txt when running as lambda

Open iaincollins opened this issue 5 years ago • 2 comments

Hi, thanks for this module, it's great!

I've been migrating more and more things to serverless, and ran into an issue with it.

When I call unfluff() from a lambda it fails and exception is thrown:

{
    "errno": -2,
    "code": "ENOENT",
    "syscall": "open",
    "path": "/var/task/user/api/content/data/stopwords/stopwords-en.txt"
  }

I don't have additional information right now but thought I'd log it as an issue.

This is running on the now.sh platform, and it's possible it's a weird artefact of their build process.

If anyone is using this library on lambda in AWS I'd appreciate knowing that so can close this off and raise it over there instead.

iaincollins avatar Feb 26 '19 01:02 iaincollins

Yeah, I have the same issue. My code is also running on now.sh If you find a solution, I would also be quite interested. 👍

hamedb89 avatar Mar 03 '19 18:03 hamedb89

There is a hack you can apply for this issue. Feed stopwords-en.txt from S3 as an additional parameter and it will work like a charm.

devarpi-zz avatar Apr 10 '19 19:04 devarpi-zz