-
-
Notifications
You must be signed in to change notification settings - Fork 897
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
Throwing AbortException when unmounting react-pdf components before PDF is finished rendering #651
Comments
Did you ever figure out how to handle this? I am getting the same error. |
I did not fix it. What I did, for a variety of reasons, was show the PDF one page at a time and I do not show the 'close' controls until the page is loaded. |
Have the same issue. Very annoying if you have some quite big pdf-s. Unhandled exception basically crashes the app so it's quite an issue when you want to implement some navigation :) |
I receive this error when I am opening several pages in a modal, for example, and I close it before all are loaded. Is there any way to lazyload on scroll? |
Has anyone come up with a non-blocking solution or workaround for this? Edit: looks like this only happens in development mode for me. I don't have a crash on the app in production. |
Same issue here. No fix yet? |
I have the same issue too. |
I did not find a solution for the problem, but luckily the crash is happening in the development mode only and not in the production :) |
@wojtekmaj This may be relevant https://github.com/mozilla/pdf.js/pull/12144/files |
Still getting this error React PDF version 5.2.0. It's also happening in production for me. |
I was able to skip this problem in react-pdf v5.2.0 Try the next steps.
Check chrome dev tools/task manages. It should use worker from the public folder. Here is a tutorial I found for react-pdf v4.1.0. |
I'll try this out. Thank you @sokoloveugene! |
@zxlin Yeah, it didn't seem to fix my issue either. I did try installing the v5.3.beta.3 version and it seems it's fixed there. At this point I've resigned myself to waiting for 5.3 to be released to fix this |
Oh that's promising to hear about v5.3! thanks for the update! |
v5.3.0 is now released. Glad to know it helped! |
If there is anyone still suffered from this issue, just change the import-alias. import { Document, Page } from "react-pdf/dist/esm/entry.webpack"; from #729 |
@goodlana solution did not work for me. It only worked when launching the app with |
See the same error using v5.7.2, any solution how to resolve? |
I also have the same problem on 5.7.2 |
Having the same issue on v6.2.2 |
We started seeing this in 7.4.0 when running our tests. It almost seems like something is faster now, which causes this to kick in. It definitively has something to do with our tests giving the |
Same issue on 7.6.0 |
same issue on v9, why is this closed? |
What are you trying to achieve? Please describe.
I'd like to be able to unmount my PDF viewer component before the PDF is finished rendering, without having an unhandled promise exception.
Describe solutions you've tried
I have tried using the available onRenderError, onLoadError, etc props. I've also tried wrapping the component in an ErrorBoundary, however it does not catch this error.
Additional information
This is an unhandled promise exception from within PDF.js. I wonder if this exception could be handled within your library or if a prop could be exposed to handle this error. I imagine others have come across this error and I wonder how others have solved this.
When unmounting the
<Document>
and<Page>
before it is finished rendering:Using this worker:
'react-pdf/dist/esm/entry.webpack.js'
Environment
The text was updated successfully, but these errors were encountered: