Skip to content
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

Error with PDFDownload Link #2911

Open
robSanders818 opened this issue Oct 21, 2024 · 3 comments
Open

Error with PDFDownload Link #2911

robSanders818 opened this issue Oct 21, 2024 · 3 comments

Comments

@robSanders818
Copy link

robSanders818 commented Oct 21, 2024

Describe the bug
I'm getting the following error while trying to use PDFDownloadLink to create a button to download the pdf:
I should also say I am using material ui, and have a material ui table inside the document I am trying to render. Looks like removing this component bypasses the error.
react.development.js:1638 Uncaught TypeError: dispatcher.useInsertionEffect is not a function at useInsertionEffect (react.development.js:1638:1) at Insertion (emotion-styled-base.browser.esm.js:45:1) at Jd (react-reconciler.production.min.js:64:1) at ig (react-reconciler.production.min.js:160:1) at hg (react-reconciler.production.min.js:139:1) at bg (react-reconciler.production.min.js:138:1) at Of (react-reconciler.production.min.js:132:1) at react-reconciler.production.min.js:30:1 at unstable_runWithPriority (scheduler.development.js:818:1) at hc (react-reconciler.production.min.js:29:1)Caused by: React ErrorBoundary TypeError: dispatcher.useInsertionEffect is not a function at PDFDownloadLink (http://127.0.0.1:3000/static/js/bundle.js:250444:5)

To Reproduce
I'm using react 18.2/react-dom 18.2 and have the following component rendered in a file
<PDFDownloadLink document={<Doc/>} fileName="fileName.pdf"> {({ blob, url, loading, error }) => loading ? 'Loading document...' : 'Download now!' }</PDFDownloadLink>

Expected behavior
A link showing to allow me to download the pdf

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Chrome
  • React-pdf version 4.0.0
@acomanescu
Copy link

Does this happen in Next.js 15? Because I encountered similar issues with React Reconciler.

@robSanders818
Copy link
Author

Does this happen in Next.js 15? Because I encountered similar issues with React Reconciler.

I'm not sure I'm not using Next.js personally but it wouldn't shock me

@diegomura
Copy link
Owner

Can you provide a reprod case? I can't tell from the PR description what's going on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@diegomura @acomanescu @robSanders818 and others