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

TypeError: context.done is not a function #223

Closed
tyshcr opened this issue Apr 11, 2017 · 3 comments
Closed

TypeError: context.done is not a function #223

tyshcr opened this issue Apr 11, 2017 · 3 comments

Comments

@tyshcr
Copy link

tyshcr commented Apr 11, 2017

I am using Node v6.2.2 and the latest version of node-lambda.

I am able to run my lambda locally using node-lambda run, but if I use context.succeed() or context.done() I get an error in my Terminal that says:

/node_modules/aws-sdk/lib/request.js:31 throw err; ^ TypeError: context.done is not a function

I found a similar issue from 2016 being discussed here #50

@abetomo
Copy link
Contributor

abetomo commented Apr 11, 2017

@tyshcr
Context.succeed () or context.done () is the way Node v0.10.42 is written.
Currently supports Node.js 6.10 and Node.js 4.3 in Lambda. Context.succeed () etc is deprecated in Node.js 6.10 and Node.js 4.3.
Thus, node-lambda stopped support forcontext.succeed ()orcontext.done ().

http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-using-old-runtime.html

@tyshcr
Copy link
Author

tyshcr commented Apr 11, 2017

I see. Thank you.

I will implement callback(null, 'Success message')

@tyshcr tyshcr closed this as completed Apr 11, 2017
CodyReichert added a commit to assertible/lambda-cloudwatch-slack that referenced this issue May 3, 2017
In the newer versions of `node-lambda` the `context.suceed` and
`context.done` methods have been deprecated, but we use those
functions (for now) still. This pins that package to version 0.8.11,
which has the functionality we need.

Fixes #12
Ref: motdotla/node-lambda#223
@ajaxsandip
Copy link

my fault was , i forgot to use path.join while using sendFile...

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

No branches or pull requests

3 participants