question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

On the fly rendering - Cannot set property 'getCurrentStack' of undefined

See original GitHub issue

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 image

Any help thanks.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:24 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
tkreiscommented, Apr 27, 2021

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.

2reactions
markusjohnssoncommented, Apr 25, 2019

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found