diegomura / diegomura/react-pdf

Uncaught TypeError: Eo is not a function with PDFDownloadLink [repro included]

Open
#3,178 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
16.8k
Forks
1.3k
Avg merge
5h 6m
Merged PRs (30d)
52

Description

**Describe the bug**
Using `` will crash with `Uncaught TypeError: Eo is not a function` as soon as as the `key` attribute of any node within `doc` changes.

**To Reproduce**
A minimal reproduction can be found at https://github.com/warrenfalk/react-pdf-issue-repro

1. git clone https://github.com/warrenfalk/react-pdf-issue-repro
2. cd react-pdf-issue-repro
3. pnpm install
4. pnpm run dev
5. Click the button
6. Page blanks because of error, open dev console to see the error
7. See src/App.tsx

This is due to the `key={count}`. If you remove this, the error goes away

Note: it would be easy to remove the `key` attribute in this repro of course, but it is not possible to remove it in rendering arrays and similar situations, of course, which is where we encountered this bug.

**Expected behavior**
It does not crash.

**Screenshots**

![Image](https://github.com/user-attachments/assets/8e6aa3f8-d0fe-4d54-86db-d5991c77a67a)

**Desktop (please complete the following information):**

- OS: Linux, (but seems to happen everywhere)
- Browser Chrome
- React-pdf version "@react-pdf/renderer": "^4.3.0"
- React 19

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.