retinal icon indicating copy to clipboard operation
retinal copied to clipboard

Cannot find src/handler

Open Jaikant opened this issue 6 years ago β€’ 5 comments

While deploying the lambda function, I was getting an error of not being able to find the handler function. I then modified the serverless.yml and prefixed it with src like below

functions:
  sharpImage:
    description: Resizes images
    memorySize: 1024
    timeout: 30
    handler: src/handler.processImage

The deploy went fine, but now while invoking it I get the following error:

$ yarn run invoke
yarn run v0.23.4
$ serverless invoke --function sharpImage --path ./event.json --log 
{
    "errorMessage": "Cannot find module '/var/task/src/handler'",
    "errorType": "Error",
    "stackTrace": []
}
--------------------------------------------------------------------
START RequestId: df6381c6-f0a5-11e7-baa4-a70b2f9693d9 Version: $LATEST
Unable to import module 'src/handler': Error
    at require (internal/module.js:20:19)
END RequestId: df6381c6-f0a5-11e7-baa4-a70b2f9693d9
REPORT RequestId: df6381c6-f0a5-11e7-baa4-a70b2f9693d9	Duration: 0.43 ms	Billed Duration: 100 ms 	Memory Size: 1024 MB	Max Memory Used: 21 MB	


 
  Error --------------------------------------------------
 
  Invoked function failed
 
     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Forums:        forum.serverless.com
     Chat:          gitter.im/serverless/serverless
 
  Your Environment Information -----------------------------
     OS:                     darwin
     Node Version:           8.8.0
     Serverless Version:     1.24.1
 
error Command failed with exit code 1.

Jaikant avatar Jan 03 '18 16:01 Jaikant

Hi @Jaikant β€” The master branch is currently broken. Try the v0.11.0 tag, or grab the source from the v0.11.0 release instead. 😊

adieuadieu avatar Jan 03 '18 21:01 adieuadieu

Ok that makes sense :) I shall be back from my holidays next week and try it out.

On 04-Jan-2018 2:45 AM, "Marco LΓΌthy" [email protected] wrote:

Hi @Jaikant https://github.com/jaikant β€” The master branch is currently broken. Try the v0.11.0 tag, or grab the source from the v0.11.0 release https://github.com/adieuadieu/retinal/releases/tag/v0.11.0 instead. 😊

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/adieuadieu/retinal/issues/57#issuecomment-355129305, or mute the thread https://github.com/notifications/unsubscribe-auth/ADT8tTie-BMp-ZfF6iAl_TzS7gTiAF6gks5tG-3_gaJpZM4RR-pK .

Jaikant avatar Jan 04 '18 02:01 Jaikant

Hey, It worked very well! thanks for the awesome library :)

Jaikant avatar Jan 23 '18 02:01 Jaikant

@adieuadieu Hi, I also had the same problem so I I've installed with the tag version but it's not working. is it working well?

love8587 avatar Feb 19 '18 11:02 love8587

@love8587 β€” yes 0.11.0 should work fine. What issue are you having/what error are you seeing?

adieuadieu avatar Feb 19 '18 13:02 adieuadieu