Home > Mobile >  Reactjs - You may need an additional loader to handle the result of these loaders
Reactjs - You may need an additional loader to handle the result of these loaders

Time:07-14

After deleting the node module and yarn.lock I run yarn install and I dont know why i received this error, please help. Thanks

I used react js for this one.

./node_modules/pdfjs-dist/build/pdf.js 2119:34
Module parse failed: Unexpected token (2119:34)
File was processed with these loaders:
 * ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js  
You may need an additional loader to handle the result of these loaders.
|           async destroy() {
|             this.destroyed = true;
>             await this._transport?.destroy();
|             this._transport = null;
|

CodePudding user response:

Try using the newest version of pdfjs.

CodePudding user response:

The general idea is to add async/await parsing support in babel.

Try this in your babel config file:

"plugins": [
  "@babel/plugin-transform-runtime",
...
],

Ref:

babel doesn't parse async await

  • Related