Next.js Discord

Discord Forum

@react-pdf/renderer

Unanswered
Meeedo7 posted this in #help-forum
Open in Discord
- I am using this library to generate and download PDFs in My Next.js15 web app, but whenever I tried to render a component (button to download or view the pdf) with <PDFDownloadLink> or <PDFViewer> from react/pdf I got an error that is shown in the image.
- I am getting the data that should be used to generate the PDF from a Form (using react-hook-form) in a client component, and also the button to download or view the pdf is presented inside this client component.
- I tried these solutions from the web:
-> using dynamic import with ssr: false.
-> using "use client" with useState and useEffect to render the button only if isClient = true.
But I didn't succeed. Is there a way to solve this problem or has anyone faced the same scenario when they need to get data to create a dynamic pdf file and faced this error.
Thank you🫡

2 Replies

Short-tailed Albatross
@Meeedo7
what are the updates on your project?
i am just using react pdf to show pdfs but its giving me drama