Wednesday 7 June 2017

Unexpected token function for koa-bodyparser

I am trying to use babel for compilation of my KOA code.But when I run my code, it gives me below error:

return async function bodyParser(ctx, next) {
           ^^^^^^^^
SyntaxError: Unexpected token function
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Module._extensions..js (module.js:579:10)
at Object.require.extensions.(anonymous function)

Node version : 6.10.3



via Snehal Nagdeote

No comments:

Post a Comment