diegomura / diegomura/react-pdf

Next.js 15 broken renderToStream

Open
#2,994 17 comments 11 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
16.8k
Forks
1.3k
Avg merge
5h 6m
Merged PRs (30d)
52

Description

My code runs on a Next.js 15 API route, so in a Node environment.
I get the same error as in this [issue](https://github.com/diegomura/react-pdf/issues/2940):
```
Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7B%24%24typeof%2C%20type%2C%20key%2C%20props%2C%20_owner%2C%20_store%7D&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
```

**Everything worked before I switched to Next.js 15.**

**To Reproduce**
Simply create a custom Next.js API route and paste this code:
```ts
import ReactPDF from '@react-pdf/renderer'

export async function POST() {
const MyDocument = () => (


React-pdf


);

const readStream = await ReactPDF.renderToStream();

// ...
}
```

**Expected behavior**
I shouldn't get an error thrown at me during this process.

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

- OS: macOS
- Browser: chrome
- React-pdf version: 4.1.5

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.