I am using the react-pdf node module package to display PDFs in a React application and running using storybook. Earlier, I was using react-pdf version 4.1.0, and it was working fine, but after updating the package to the latest version, i.e., 6.2.1, it started to give me the below error when I am trying to run the storybook.
ERROR in ./node_modules/pdfjs-dist/build/pdf.js 1413:9
Module parse failed: Unexpected character '#' (1413:9)
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
|
| class PDFDocumentLoadingTask {
> static #docId = 0;
|
| constructor() {
@ ./node_modules/react-pdf/dist/esm/entry.webpack.js 1:0-46 9:0-25 10:0-42
I am using the following versions of the below packages:
react: 16.12.0
react-dom: 16.12.0
react-pdf: 6.2.1
typescript: 3.7.2
@storybook/react: ^6.1.21
Note: I have Node 14 on my system