Something about the transpiling this class with babel-preset-2015 will cause Electrolyte to be unable to create the object:
'use strict';
class Test {
async home() {
}
}
module.exports = function() {
return new Test();
};
module.exports['@singleton'] = true;
The two specific things that cause the error are the async function, and using babel-preset-es2015. So if you're using babel-preset-latest, this problem will occur since that includes es2015. Using babel-preset-2016 and babel-present-2017 will not cause this problem.
Since the ES2015 (ES6) features are all part of the most recent versions of (Node 6+) this isn't really a huge problem since you don't need to transpile for ES6 anymore. I just wanted to post this here in case anybody else bangs there head against the wall trying to figure out why the most basic usage of this package isn't working.
Removing the "async" part of the function or not using babel-preset-es2015 fixes the problem.
Something about the transpiling this class with babel-preset-2015 will cause Electrolyte to be unable to create the object:
The two specific things that cause the error are the async function, and using babel-preset-es2015. So if you're using babel-preset-latest, this problem will occur since that includes es2015. Using babel-preset-2016 and babel-present-2017 will not cause this problem.
Since the ES2015 (ES6) features are all part of the most recent versions of (Node 6+) this isn't really a huge problem since you don't need to transpile for ES6 anymore. I just wanted to post this here in case anybody else bangs there head against the wall trying to figure out why the most basic usage of this package isn't working.
Removing the "async" part of the function or not using babel-preset-es2015 fixes the problem.