ajmath / serverless-offline-scheduler

MIT License
96 stars 40 forks source link

Unexpected token export #17

Closed walshe closed 5 years ago

walshe commented 5 years ago

does it have issue with es6/7 ?

`export const job = async (event, context, callback) => { ^^^^^^

SyntaxError: Unexpected token export at createScript (vm.js:80:10)`

ajmath commented 5 years ago

This looks like a problem with the node version that serverless is executing under not knowing how to interpret your handler source. Could you provide some more details?

walshe-boylesoftware commented 5 years ago

when I changed it to "module.exports.job = ".. it worked

would be nice for it to support newer versions of ecma script though

ajmath commented 5 years ago

The plugin is not tied to any specific version of ecma script, it's just executing the node handler functions the same as lambda will. I suspect that you will want to look into using serverless-webpack if you want your lambdas to run with modern JS features.