Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR in ./node_modules/@feathersjs/hooks/esm/base.js 55:38 #101

Open
andysay opened this issue Apr 25, 2022 · 4 comments
Open

ERROR in ./node_modules/@feathersjs/hooks/esm/base.js 55:38 #101

andysay opened this issue Apr 25, 2022 · 4 comments

Comments

@andysay
Copy link

andysay commented Apr 25, 2022

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?

@daffl daffl transferred this issue from feathersjs/feathers Apr 25, 2022
@daffl
Copy link
Member

daffl commented Apr 25, 2022

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.

@andysay
Copy link
Author

andysay commented Apr 25, 2022

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;
|   }

@daffl
Copy link
Member

daffl commented Apr 25, 2022

Whoops, just confirmed, the required preset is ES2020.

@andysay
Copy link
Author

andysay commented Apr 25, 2022

preset

will be babel-loader or stay es2020 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants