-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Nested arrow async functions #230
Comments
What's the stack trace? Sorry not at my computer at the moment. |
|
I've seen the same thing via babel, the error message you get back in this case is mega deceptive. |
I get the same |
async function registerApps(app, r) {
console.log('server listening, registering apps')
let appModulePaths = await glob('./api/*/app.js', { cwd: 'server' })
// regenerator forces me to use non-arrow function... stupid bug
return Promise.map(appModulePaths, function(appModulePath) {
let appName = path.dirname(path.relative('api', appModulePath))
let ApiApp = require(appModulePath)
console.info('loading app', appName)
return buildApp(ApiApp, r, app).then(router => {
app.use(`/${NAMESPACE}/${appName}`, router)
})
}) This here it won't accept in arrow function in the |
I ran into this at FB as well when trying an experiment couple weeks ago. Was just about to report and here it is, fixed. @benjamn thank you! |
@benjamn it seems that regenerator always transpiles to arrow functions now (due to transform-es2015-arrow-functions)? Is it possible to have it working with nested arrows while still outputting them? Should I open a new issue? |
@kangax I agree that forcing all arrow functions to be transpiled is overkill. Can you open a new issue to handle arrows in the transform (rather than assuming they've all been transpiled already)? |
I'm having this issue at the moment using:
But only on a windows machine. On a linux machine no problems compiling. Edit: I had everything installed using |
It can't parse this. It seems the syntax is OK.
The text was updated successfully, but these errors were encountered: