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.

No matching handler found for 'handler'. Check your service definition

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Comments:23 (13 by maintainers)

github_iconTop GitHub Comments

5reactions
vcarelcommented, Jul 28, 2017

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

module.exports = {
  entry: ['./src/server/handler.js']

So, at the end, the fix was to set the path in the handler definition:

functions:
  my_function:
    handler: src/server/handler.my_function
2reactions
HyperBraincommented, Jul 28, 2017

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:

// webpack.conf.js
const slsw = require('serverless-webpack');
module.exports = {
  entry: slsw.lib.entries,
  ...
  output: {
    ...
    filename: '[name].js',
    ...
  }
};

Then you can add functions to your service without changing the config again.

Read more comments on GitHub >

github_iconTop 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 >

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