hooks
hooks copied to clipboard
ERROR in ./node_modules/@feathersjs/hooks/esm/base.js 55:38
ERROR in ./node_modules/@feathersjs/hooks/esm/base.js 55:38
Module parse failed: Unexpected token (55:38)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| }
| middleware(middleware) {
> this._middleware = middleware?.length ? middleware : null;
| return this;
| }
how fix it?
Your module loader needs to be configured to transpile this module using a modern version of Javascript (ES2018 or later I believe) - there is additional documentation on module loaders in the Feathers client API.
Your module loader needs to be configured to transpile this module using a modern version of Javascript (ES2018 or later I believe) - there is additional documentation on module loaders in the Feathers client API.
okay, i'm added
config.module.rules.push({
test: /\.jsx?$/,
exclude: /node_modules(\/|\\)(?!(@feathersjs|debug))/,
loader: 'babel-loader'
})
and still have this
Module parse failed: Unexpected token (59:34) friendly-errors 21:09:58
File was processed with these loaders:
* ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|
| middleware(middleware) {
> this._middleware = middleware?.length ? middleware : null;
| return this;
| }
Whoops, just confirmed, the required preset is ES2020.
preset
will be babel-loader or stay es2020 ?