Cannot resolve module 'react-pdf/dist/entry.webpack'
also constantly see Unexpected token <
I'm having a similar problem, I have created a post on stackoverflow (https://stackoverflow.com/questions/48700484/uncaught-syntaxerror-unexpected-token-reactjs-react-pdf) without any significant responses.
The cause of my issue appears to be where I import 'react-pdf/build/entry.webpack' into my component. I am not getting a "Cannot resolve module" error, but I am getting the "Unexpected token <" error.
File is located in node_modules/react-pdf/build/entry.webpack.js within node_modules so the /dist/ documentation may be outdated.
Guys,
files are located in /dist starting with 3.0.0. If I released 2.x branch with /dist catalog instead of /build, that's a breaking change that needs to be fixed.
Please mind that README.md that's located on GitHub is for the newest version I'm working on; you need to choose specific version tag to see README for older versions.
Please, could you check what versions are you on?
I was on 2.5.4
Upon switching to 3.0.0-alpha.4 I receive the same error after changing the import from 'react-pdf/build/entry.webpack' to 'react-pdf/dist/entry.webpack'
I'm still using 2.5.4
I had copied your example to test with so I changed the path as you said which removed the error Unexpected token <
I am getting the error: Invalid PDF structure
name: "InvalidPDFException"
Not sure if this is related. I havn't found an solutions and kuehlein's doesn't help as I'm not using a constructor. Any guidance would be appreciated.
No, this is not related @Richwb. Please file separate issue and I'll try and see what can be done. Please also include code samples!
+1
why it has been closed without any proper solution?
I still facing the same issue Module not found: Error: Can't resolve 'react-pdf/dist/entry.noworker'
Module not found: Error: Can't resolve 'react-pdf/dist/Page/AnnotationLayer.css'
@rajbir123 You must be using an older version of React-PDF, the issue you're actually facing seems to be https://github.com/wojtekmaj/react-pdf/issues/133, or you recently upgraded to a next breaking version without following upgrade guide.
@wojtekmaj hi bro actually i am looking for pdf to image library. can u help me in that or this library will execute the same?
Most helpful comment
File is located in
node_modules/react-pdf/build/entry.webpack.jswithin node_modules so the/dist/documentation may be outdated.