0

Facing this error today without updating any package

Failed to compile.

./node_modules/@react-pdf/png-js/lib/png-js.browser.es.js 10116:106
Module parse failed: Unexpected token (10116:106)
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.
|  */
|
> function gen_bitlen(s, desc) /*    deflate_state *s;*/ /*    tree_desc *desc;    /* the tree descriptor */*/{
|   var tree = desc.dyn_tree;
|   var max_code = desc.max_code;

package.json packages are as follows

"dependencies": {
    "@react-pdf/renderer": "2.1.1",
    "@react-pdf/font": "2.2.0",
    "react-scripts": "4.0.1",
},
"scripts": {
    "start": "craco start",
    "build": "craco build",
    "test": "craco test",
    "eject": "craco eject"
  },
"browserslist": [
    ">0.2%",
    "not dead",
    "not op_mini all"
  ],

Tried adding @react-pdf/font in resolutions but still won't work

"resolutions": {
    "@react-pdf/font": "2.2.0"
  },

Also i have tried removing node_modules,package-lock.json and also tried clearing cache using npm cache clean --force but still same issue persist.

Faizan Ahmad
  • 304
  • 3
  • 13

0 Answers0