Running Adonis through Babel, everything works fine apart from the controller mapping mechanism.
Works fine
Route.get('version', function * (request, response) {
response.send('okay')
})
Doesn't like the export
Route.get('version', 'UtilsController.version')
export default class UtilsController {
* version (request, response) {
response.send('okay')
}
}
Is this an issue with the way adonis-fold does dependancy injection?
Dear @milosdakic !
Adonis does not support any transpiler like Babel nor TypeScript.
Babel 6.0 transpile export default with module.export.default = {} this is probably why it is not working.
You may try to use this Babel plugin babel-plugin-add-module-export.
Yup that is the reason. Also I believe using babel is redudant ( in my view ). Node.js latest versions are almost compatible with ES6 specs
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.