I\' ve come across this strange occurrence of:
ReferenceError: regeneratorRuntime is not defined
... which I\'ve managed to reproduce in a very minima
Babel assumes that the polyfill will be loaded before anything else in your application, but you're using a function declaration, which is hoisted, meaning that it exists and is usable before require
has been called.
In the case of generators, then need regeneratorRuntime
which is provided by the polyfill, but the polyfill hasn't loaded when the regenerator is initialized.
The Babel team's recommendation is to make two files:
require('babel-polyfill');
require('./app');