You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting an error: SyntaxError: Unexpected token export
Works fine when function invoked locally, but not on lambda.
I'm guessing that babel isn't transpiling the code?
Error on CloudWatch logs:
Syntax error in module 'handler': SyntaxError
(function (exports, require, module, __filename, __dirname) { export const fetchQuotes = (event, context, callback) => {
^^^^^^
SyntaxError: Unexpected token export
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
exportconstfetchQuotes=(event,context,callback)=>{constresponse={statusCode: 200,headers: {"Access-Control-Allow-Origin" : "*","Access-Control-Allow-Credentials" : true// Required for cookies, authorization headers with HTTPS},body: JSON.stringify(event)};constfetchData=async()=>{}callback(null,response);// Use this code if you don't use the http event with the LAMBDA-PROXY integration// callback(null, { message: 'Go Serverless v1.0! Your function executed successfully!', event });};
Getting an error:
SyntaxError: Unexpected token export
Works fine when function invoked locally, but not on lambda.
I'm guessing that babel isn't transpiling the code?
Error on CloudWatch logs:
serverless.yml
webpack.config.js
package.json
handler.js
And output of console after entering
sls deploy
:The text was updated successfully, but these errors were encountered: