question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find src/handler

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Jaikantcommented, Jan 23, 2018

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

0reactions
adieuadieucommented, Feb 19, 2018

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

cURL error 6: Could not resolve host, after successfully ...
I need to update all media in a larger Shopware shop, with about 10000 products. I use the Shopware php SDK by vienthuong....
Read more >
Uncaught GuzzleHttp \Exception \ConnectException
Hi while I was going to the admin dashboard, I got (HTTP ERROR 500) and this was the error message: [13-Apr-2021 14:42:17 UTC]...
Read more >
Fatal Error | WordPress.org
... not found in /home/mstpeters/public_html/wp-content/plugins/skaut-google-drive-gallery/bundled/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:201 ...
Read more >
Why give this error? - HubSpot Community
Search APIs & Integrations for solutions or ask a question ... /opa/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:185 Stack trace: #0 ...
Read more >
something wrong in reportDefinition? - Google Groups
But at the moment, i don't know, what is missing. ... in C:\Users\ladewig\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:187 Stack trace: #0 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found