react-pdf
react-pdf copied to clipboard
react-pdf v6 Module parse failed: Unexpected character '#'
Before you start - checklist
- [X] I followed instructions in documentation written for my React-PDF version
- [X] I have checked if this bug is not already reported
- [X] I have checked if an issue is not listed in Known issues
- [X] If I have a problem with PDF rendering, I checked if my PDF renders properly in PDF.js demo
Description
Our team is waiting for a new version of react-pdf with a new build of pdfjs-dist, which has a fix for Hebrew, so for the test, we tried to install the 6th version of react-pdf but after installation we got the following error
Steps to reproduce
install react-pdf 16 or 17 react-scripts: 3.4.4 implement [email protected]
Expected behavior
Actual behavior
./node_modules/pdfjs-dist/build/pdf.js 1390:17
Module parse failed: Unexpected character '#' (1390:17)
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.
|
| class PDFDocumentLoadingTask {
> static #docId = 0;
|
| constructor() {
Additional information
how can we solve this problem? Thank you
Environment
- Browser (if applicable): chrome
- React-PDF version: 6
- React version: 17
- react-scripts: 3.4.4
Hmmm, tried running 6.0.0-beta.3 with my Create React App 5 sample app and it went without any issues. I suspect react-scripts 3.4.4 might be a bit too old 🤔
Same issue here. As far as I am concerned react-scrits 3.x.x still seems to be pretty common these days and migrating to 4.x branch sometimes is not an option for any reason
Any chances to get some help with this?
Maybe it's possible to update Babel manually? I hope they didn't pin Babel version in CRA?