-
-
Notifications
You must be signed in to change notification settings - Fork 898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
react-scripts: 2.0.3 breaks dependencies in lib/display/api.js and build/pdf.js v3.0.5 #280
Comments
Hello, Webpack 4 is not supported officially at the moment, but will be in version 4 - have you tried using it instead by installing |
yes.it's incompatile with react-script-2 |
Check your console and look if your error is mentioned in Known issues. I just updated it while I was handling a similar issue. |
Create React App is not yet compatible with worker-loader. It will be once facebook/create-react-app#3934 gets merged. For now, users of Create React App both 1.x and 2.x need to use generic solution. |
@wojtekmaj May you confirm that generic solution means
and manual copy of the pdf.worker.js file from pdfjs-dist/build is project's output folder. |
Yes, that is the generic solution @tzieleniewski. You can also use CopyWebpackPlugin to do it with every build. |
@tzieleniewski @wojtekmaj |
So to confirm, there is a working solution, but we're still unable to get rid of the
|
Correct. I'll be working with Mozilla to getting that fixed once for good, but it will take some time. |
Hi!
|
@adnux If you are upgrading, then your old implementation will not work. You will need to follow the Browserify & Others documentation. Your imports/setup will probably look something like this... import { pdfjs, Document, Page } from 'react-pdf';
pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.js`; |
Hi! I still get this error message.
Environment
|
This warning seems to be related to Mozilla's PDF.js using |
Is there any temporary fix to this problem at present? |
@varunpatro I am using craco to allow modification of CRA webpack config, and I remove the Here is craco.config.js code I use, maybe it will help someone.
|
Same CI issue as @maciejmatu - I will look into his hack but the person who fixes this properly will have my undying gratitude. |
Same CI issue as @MaciejMat |
Environment
@maciejmatu Hack works. But are there any other solutions or updates on this issue? Thanks! |
Hello, the same issue any updates? |
This is holding us back actually using your library. It means that in most cases, the CI software will not let this through, as warnings are interpreted as errors. And for a lot of people, @maciejmatu's solution won't work because we don't want to work around CRA default scripts. So this means either dropping react-pdf or finding some kind of a solution.. Which neither really is to my liking :/ |
@akuji1993 You can also disable warnings in your CI (which cause broken builds) by doing something like this: |
@mikemclin that's generally not a good idea because quite a few tools behave differently when running under CI |
@simoneb you only need to turn the |
Hey guys, any updates on this problem? I managed to use the library following the tip from @mikemclin:
But I still get the warning:
Any current solution without using react-app-rewired? |
Hey @wojtekmaj . v2.4.456 is LTS now https://github.com/mozilla/pdf.js/releases/. Can we look into merging this PR #550 ? |
Pinging this in hopes that this issue might be fixed soon? Any updates? |
React-PDF 5.0.0-beta.4 is out with pdf.js 2.4.456 under the hood. Feedback from those previously affected by this bug is welcome :) |
I can confirm, with 5.0.0-beta.4 the error message is gone for me |
error is gone with 5-beta.4 |
No errors in 5.0.0-beta.4. Waiting for the stable version. |
I'm facing same problem:
I would thanks any help |
@PedroRuiz just to confirm, you deleted the npm_modules folder? Before install again the packages? |
@wojtekmaj Hm. I get massive performance degradation and some odd behavior when upgrading from |
Please mind that this thread is for this specific error only. Please use #495 for general 5.0 beta discussion. |
@GabrielF9 I did it. |
@PedroRuiz Oh, I maked this and got all works fine. Can you share the part of code where you use the react-pdf? |
@GabrielF9 I don't know why, it goes fine now. I apologize for inconvenience |
@PedroRuiz happens hahahaha happy it worked |
@wojtekmaj |
If not for the performance degradation it'd be already live. I don't think there will be any developer facing changes at this point though. |
Yes!!!, after upgrading to React-PDF 5.0.0-beta.4, the warning is gone! |
It there any chance to resolve this error at 4.x version? I cannot use 5.x because of compatibility with IE11 :-/ |
There's no way. The first version pdfjs shipped with this issue was actually the one that already dropped IE11 support, which we noticed later. |
I havent got any solution myself too & still stuck on the same prob. |
As I said there's absolutely no way 4.x will have this issue fixed. Either upgrade to 5.x or live with it. Sorry. |
Bumped to 5.2.0 and still seeing this error message.
The irony here is that I don't even need this package. I don't display PDFs. The "standard" instructions don't work for me because I don't call on this package ever. It became a complete block when I moved to TS v4 coupled with another dependency upgrade I was testing out. UPDATE: As advised, I fixed my TS config. If anyone is still getting these messages on Webpack 4, go back and walk through all your types and configuration. I added back a huge list of packages and it magically fixed itself.
|
The React app build failed with the previous version of `pdfjs-dist` due to a dynamic require. See wojtekmaj/react-pdf#280 (comment). This commit updates it to the first version that fixed the problem (I've had issues with newer versions of `pdfjs-dist`, though we should try again at some point).
The React app build failed with the previous version of `pdfjs-dist` due to a dynamic require. See wojtekmaj/react-pdf#280 (comment). This commit updates it to the first version that fixed the problem (I've had issues with newer versions of `pdfjs-dist`, though we should try again at some point).
The React app build failed with the previous version of `pdfjs-dist` due to a dynamic require. See wojtekmaj/react-pdf#280 (comment). This commit updates it to the first version that fixed the problem (I've had issues with newer versions of `pdfjs-dist`, though we should try again at some point).
Updating create-react-app to v2.0.3 has resulted in this node module to not load PDFs.
Describe solutions you've tried
Deleting the module and reinstalling via npm install has resulted in the same issue.
Additional information
If applicable, add screenshots (preferably with browser console open) and files you have an issue with to help explain your problem.
Environment
The text was updated successfully, but these errors were encountered: