Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

Cannot find src/handler #57

Closed
Jaikant opened this issue Jan 3, 2018 · 5 comments
Closed

Cannot find src/handler #57

Jaikant opened this issue Jan 3, 2018 · 5 comments

Comments

@Jaikant
Copy link

Jaikant commented Jan 3, 2018

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.
@adieuadieu
Copy link
Owner

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. 😊

@Jaikant
Copy link
Author

Jaikant commented Jan 4, 2018 via email

@Jaikant
Copy link
Author

Jaikant commented Jan 23, 2018

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

@love8587
Copy link

@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?

@adieuadieu
Copy link
Owner

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants