Recently, I have installed pdfjs-dist
in my React project. After importing it, I'm getting below error while running.
./node_modules/pdfjs-dist/build/pdf.js
SyntaxError: /Users/XXXXXXXXXXX/Documents/dev/XXXXXXXXXXX/node_modules/pdfjs-dist/build/pdf.js:Missing class properties transform.
2880 | #isEditing = false;
2881 | #isInEditMode = false;
> 2882 | _uiManager = null;
| ^^^^^^^^^^^^^^^^^^
2883 | #zIndex = AnnotationEditor._zIndex++;
2884 | static _colorManager = new _tools.ColorManager();
2885 | static _zIndex = 1;
- Node v12.22.12
- react "16.12.0"
- react-dom "16.12.0"
I have installed module @babel/plugin-proposal-class-properties
and changed .babelrc
as oer below. Still I'm getting the same error.
{
"presets": ["@babel/env", "@babel/preset-typescript"],
"plugins": ["@babel/plugin-proposal-class-properties"]
}
Via Active questions tagged javascript - Stack Overflow https://ift.tt/WZSJyrH
Comments
Post a Comment