developit / express-es6-rest-api

:battery: Starter project for an ES6 RESTful Express API.
http://git.io/express-es6-rest-api
MIT License
2.46k stars 552 forks source link

async/await syntax #34

Open texas697 opened 7 years ago

texas697 commented 7 years ago

I am using async/await syntax in my project. runs fine with PORT=8080 npm run dev but when i try to run via docker i get error ReferenceError: regeneratorRuntime is not defined do I need to modify babel?

escobar5 commented 7 years ago

Having the same problem, not via docker, just running in production

developit commented 7 years ago

Hi there - you need to import regenerator. Most people do this by adding this line to src/index.js after running npm i -S babel-runtime:

import 'babel-runtime';
giiska commented 6 years ago

You need babel-plugin-transform-runtime: https://stackoverflow.com/a/36821986/1252528