There have been a few questions like this in the past and the solutions given were to add a loader such as es2015. However I have tried adding es2015, 2016, 2017 (further ones and babel-preset-env
gave other errors) and none of them could load this module. Other loaders in the webpack-config.js file are react
and stage-0
.
Module parse failed: Unexpected token
You may need an appropriate loader to handle this file type.
| * @private
| */
| Exporter.prototype.<function-name> = async function * <function-name>() {
| yield '';
| };
Here's the rule for js files:
{
test: /\.js$/,
loader: 'babel-loader',
exclude: [
/node_modules/
],
query: {
cacheDirectory: true,
presets: ['es2015', 'es2016', 'es2017', 'react', 'stage-0']
}
}
and the .babelrc file:
{
"presets": ["react", "es2015", "stage-0", "es2016", "es2017"]
}
Does anyone know what loader this needs?
I am not very knowledgeable in babel, but it seems that this rule is excluding /node-modules/
and this error is coming from a module in the project. Might be relevant.
Also relevant is that this same build is working on other computers where "es2015", "es2016", "es2017"
have not been installed and were not added to presets in either of the files above.
Thanks in advance.