-
Notifications
You must be signed in to change notification settings - Fork 36
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
TypeError: Cannot read property 'action' of undefined #15
Comments
Can you tell us more about your use-case? This is intended to be specifically for Probot apps, so I'm not sure why you'd need to account for cases where |
They are not new functions, rather routes for things like health checks, statuses etc. It seems that probot supports it https://probot.github.io/docs/http/. Also, one can configure probot to receive events at a specific route via In another case, I'm trying to port an existing app, and need to support existing routes: https://github.com/ewolfe/prlint/blob/feat/probot-app/src/routes.js. Finally, as I was writing this reply, I'm seeing this note from readme in a new light. :) It'd be nice if you can support these, if not I'll try to follow the recommendation specified in the readme.
|
Yeah, that link to the README makes sense. I think its important to keep this extension very scoped - to follow standard FaaS architecture patterns, and to ensure that we're not shipping unnecessary code (in serverless functions, bundle sizes counts towards execution speed). I'm going to close this issue because I think your question is answered but feel free to reopen if I'm mistaken! |
Can't argue with bundle size and execution speed arguments! :) I think in the very least, we should at least add prominent warnings in the readme about using custom routes or using |
Couldn't hurt - PRs welcome @mrchief ❤️ |
More details: probot#15
The code at https://github.com/probot/serverless-lambda/blob/master/index.js#L51 doesn't account for cases where
event.body
could be absent (e.g. using custom routes).I think a check for
event.body.action
would at least avoid this error.A better fix would be to account for other routes and invoke
next()
instead of trying to handle it within probot.Stack trace
The text was updated successfully, but these errors were encountered: