On the fly rendering - Cannot set property 'getCurrentStack' of undefined
See original GitHub issueThere 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.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:24 (11 by maintainers)
Top Results From Across the Web
cannot set property of undefined TypeScript/React
Try making some form of check to see if there is an object at specific index eg: private handleInputChange = (index: number) =>...
Read more >How to Read React Errors (fix 'Cannot read property of ...
Got an error like this in your React component? Cannot read property `map` of undefined. In this post we'll talk about how to...
Read more >spfx kendo react in KendoReact | Telerik Forums
While its working fine in my local workbench when I go to the ... Uncaught TypeError: Cannot set property 'getCurrentStack' of undefined at ......
Read more >TypeError: Cannot set properties of Undefined in JavaScript
The "Cannot set properties of undefined" error occurs when setting a property on an `undefined` value. To solve the error conditionally check if...
Read more >Using renderToString() without a running server fails ... - Reddit
... TypeError: Cannot read property 'params' of undefined at render (/home/zhirzh/doodol/dist/build-app-shell.js:23492:27) at ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.