0

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

3
  • What is your node version? Commented Dec 30, 2022 at 17:18
  • @Konrad Node 14 Commented Dec 30, 2022 at 18:33
  • You can look at this stackoverflow.com/questions/59018117/… Commented Dec 30, 2022 at 18:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.