No matching handler found for 'handler'. Check your service definition
See original GitHub issueI just upgraded from serverless-webpack 2.0.0 to 2.2.0 and got the following error. It was working perfectly with the previous version.
No matching handler found for 'handler'. Check your service definition
Is there anything wrong in my configuration?
service: my_service
provider:
...
custom:
webpack: webpack.config.serverless.js
functions:
my_function:
handler: handler.my_function
events:
...
plugins:
- serverless-webpack
FYI I’m on serverless latest (as of today: 1.18.1)
Issue Analytics
- State:
- Created 6 years ago
- Comments:23 (13 by maintainers)
Top Results From Across the Web
Shared Handlers - Serverless Framework
We have common handlers where their functionality is different based on parameters passed in through the environment section of the serverless.
Read more >Mockery no matching handler for closure - php - Stack Overflow
My test appears to be matching the rest of the code exactly. What am I overlooking? In my test I have: $passwordBroker =...
Read more >serverless-bundle - npm Package Health Analysis - Snyk
An extension of the serverless-webpack plugin that bundles your ES6 + TypeScript Node.js ... WARNING: More than one matching handlers found for index....
Read more >Serverless Webpack - Serverless Plugin Directory
A Serverless Framework plugin to build your lambda functions with Webpack. ... seen an error like: WARNING: More than one matching handlers found...
Read more >State handlers | Dialogflow CX - Google Cloud
Every flow has event handlers for the no-match and no-input built-in events. ... If the handler has a transition target defined, the webhook...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok, found. The problem is that
slsw.lib.entries
does not contain an array, but the object{ 'src/server/handler': './src/server/handler.js' }
If I just use the previous config, it works fine
So, at the end, the fix was to set the path in the handler definition:
Ok. I think the missing path in the function definition is the problem. The function definition should define the path - otherwise you’d also get issues with other plugins that need to find the handler. The problem is, that Serverless (the framework) is completely unaware of the handler location in your case.
So, please change the handler definition in your serverless.yml.
… and the good thing: With 2.2.0 you now do not have to set the entries manually anymore in your webpack config. Just use:
Then you can add functions to your service without changing the config again.