Uncaught (in promise) TypeError: Cannot read property 'slice' of undefined
See original GitHub issuewhen I try generate blob from my document, then TypeError occured
import { pdf } from "@react-pdf/renderer";
import { saveAs } from "file-saver";
const downloadPdf = async () => {
const blob = await pdf(<Document />).toBlob(); //error here
saveAs(blob, "document.pdf");
};
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Problem with error Cannot read property 'slice' of undefined
I faced the same error today, and solved it by initializing the array to an empty array before performing any slice ...
Read more >TypeError: Cannot read Property 'slice' of Undefined in JS
The "Cannot read property 'slice' of undefined" error occurs when the slice() method is called on an undefined value. To solve the error,...
Read more >Cannot read property 'slice' of undefined error when trying to ...
Hi guys, As the title says, I am getting a Cannot read property 'slice' of undefined error in the console when trying to...
Read more >TypeError: Cannot read property 'slice' of undefined - Support
Hello, I encountered the same problem with the new version solc compiler. ... Error: TypeError: Cannot read property 'slice' of undefined at ...
Read more >TypeError: Cannot read property 'slice' of undefined - MongoDB
So you can not retrieve that token because there is no Header so there is undefined variable. You are trying to slice that...
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
@nicholasstephan you may check this workaround for 2.0
My bad! I removed the beta version as the latest on npm. I’m aware of this bug on 2.0 and will be fixed for next deploy. Thanks for addressing this!