Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: serverless-offline crashes if a function definition does not have a handler #967

Conversation

pettyalex
Copy link
Contributor

Check for the existence of a handler property before trying to have serverless-offline set up an event handler. It's possible to have mock integrations configured in API Gateway via serverless framework that have no handler and always return a static response. My team has and is using these in production, but serverless-offline cannot handle them right now.

This fix prevents serverless-offline from crashing, but it still warns WARNING: Entry for my-function-without-handler@undefined could not be retrieved.

I can provide a full example serverless.yml that triggers this bug if requested.

https://serverless.com/framework/docs/providers/aws/events/apigateway/#mock-integration

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

Successfully merging this pull request may close these issues.

None yet

2 participants