Open tobiasbueschel opened 2 months ago
This definitely look like a flavor of #1508 and #1620.
You did everything just the way I'd do. I'm puzzled. If importing PdfViewer asynchronously in <BrowserOnly>
doesn't help, maybe it'd be better to ask on Docusaurus repo why that could be the case? I don't see any reason for BrowserOnly to be executed on the server side!
Before you start - checklist
Description
Context: using
react-pdf
in the latest Docusaurus version 3.2.1npm run build
works for the client but not for the server, the following error shows up:However, running
npm start
works without any problems and I can see the PDF rendered correctly in the Docusaurus website.Steps to reproduce
npx create-docusaurus@latest my-website classic
npm install react-pdf
src/components/PdfViewer.jsx
(I've also tried with
<BrowserOnly />
inside the component, but that led to the same issue)docusaurus.config.js
:(reference from: https://github.com/syed-ahmed/docusaurus-plugin-react-pdf/blob/main/src/index.ts#L31-L42)
Expected behavior
The build succeeds.
Actual behavior
The build fails with the above mentioned error message.
Additional information
Potentially related issues & comments:
Environment