react-pdf: On the fly rendering - Cannot set property 'getCurrentStack' of undefined
There is a issue when I apply “On the fly rendering” in my react webpage. https://react-pdf.org/advanced#on-the-fly-rendering
import { PDFDownloadLink, Document, Page } from '@react-pdf/renderer'
const MyDoc = () => (
<Document>
<Page>ABC</Page>
</Document>
)
then inside the react export class:
public render(): React.ReactElement<IJsomProps> {
<div>Export</div>
<div>
<PDFDownloadLink document={<MyDoc />} fileName="somename.pdf">
{({ blob, url, loading, error }) => (loading ? 'Loading document...' : 'Download now!')}
</PDFDownloadLink>
</div>
}
it gives me this error

Any help thanks.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 3
- Comments: 24 (11 by maintainers)
Similar to @Dangerous-Mind experience, this has started to pop up in a project of mine as well. In our case it was related to us loading an production build of react and setting the env to development.
Thus causing the error inside of the react-reconciler. So at least in our case it wasn’t a bug of pdf-react.
@diegomura I’m seeing this error too (the initial one, with getCurrentStack) when using webpack with mode=development, however, it goes away with mode=production.