We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi guys,
thank you for working on lambda-local. Just tried to run a following function:
module.exports.handler = async(event, context, callback) => { console.log(event) return 'Hello from Lambda' }
$ lambda-local -l index.js -h handler -e examples/s3-put.js warning Using both auth systems: aws_access_key/id and secret_access_token ! info: START RequestId: 995c192f-b25e-28c8-6579-0cee824da6f3 /home/ec2-user/environment/test/index.js:2 module.exports.handler = async(event, context, callback) => { ^ SyntaxError: Unexpected token ( at createScript (vm.js:56:10) at Object.runInThisContext (vm.js:97:10) at Module._compile (module.js:549:28) at Object.Module._extensions..js (module.js:586:10) at Module.load (module.js:494:32) at tryModuleLoad (module.js:453:12) at Function.Module._load (module.js:445:3) at Module.require (module.js:504:17) at require (internal/module.js:20:19) at Object._executeSync (/home/ec2-user/.nvm/versions/node/v6.14.3/lib/node_modules/lambda-local/lib/lambdalocal.js:157:26) error: End - Error error: ------ error: { "errorMessage": "Unexpected token (", "errorType": "SyntaxError", "stackTrace": [ "ule.exports.handler = async(event, context, callback) => {", "", "", "taxError: Unexpected token (", "createScript (vm.js:56:10)", "Object.runInThisContext (vm.js:97:10)", "Module._compile (module.js:549:28)", "Object.Module._extensions..js (module.js:586:10)", "Module.load (module.js:494:32)", "tryModuleLoad (module.js:453:12)", "Function.Module._load (module.js:445:3)", "Module.require (module.js:504:17)", "require (internal/module.js:20:19)", "Object._executeSync (/home/ec2-user/.nvm/versions/node/v6.14.3/lib/node_modules/lambda-local/lib/lambdalocal.js:157:26)" ] } error: ------ error: Lambda failed in 18ms.
The text was updated successfully, but these errors were encountered:
This is an issue with your function, you are wrongly declaring it (SyntaxError).
Have a look at https://stackoverflow.com/a/42964310/5459467
We have an example of a working async function in our tests https://github.com/ashiina/lambda-local/blob/develop/test/functs/test-func-async.js
Sorry, something went wrong.
Yes, thank you! My node runtime was 6.xx on a new machine, haven't switched to 8.10.
Good ! Glad you fixed it
No branches or pull requests
Hi guys,
thank you for working on lambda-local. Just tried to run a following function:
The text was updated successfully, but these errors were encountered: