Uncaught TypeError: inherits4 is not a function in Nitro v3 with @react-pdf/renderer
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 11.2k
- Forks
- 899
- Avg merge
- 2d 24m
- Merged PRs (30d)
- 40
Description
Environment
- nitro-nightly@3.0.1 or nitro@3.0.1-alpha.0 (I tried with both)
- node v22
- vite v7
- react v19
Reproduction
https://github.com/Yanis02015/nitro-react-ssr. I used the react-ssr example from the vite-examples repo
To reproduce without the repo that I shared
- Install
@react-pdf/renderer - use this template anywhere on the client side
- And the client will crash, the hydration will break
import { Document } from "@react-pdf/renderer";
const PDF = () => <Document />;
// or
console.log(Document)
Describe the bug
The @react-pdf/renderer package produces the error Uncaught TypeError: inherits4 is not a function when used in client-side react.
I first had this bug on Stack Start, after they moved to V3, and so in V2 I didn't have this bug.
Additional context
No response
Logs
Uncaught TypeError: inherits4 is not a function
at node_modules/.pnpm/queue@6.0.2/node_modules/queue/index.js (@react-pdf_renderer.js?v=edf0c095:434:5)
at __require2 (chunk-PLDDJCW6.js?v=edf0c095:17:50)
at @react-pdf_renderer.js?v=edf0c095:16960:28
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with the linked nitro-react-ssr repository and the vite-examples react-ssr example using Nitro v3, then inspect the bundled queue entry at node_modules/.pnpm/queue@6.0.2/node_modules/queue/index.js and the surrounding @react-pdf/renderer bundle. Done means the client can import or render Document and complete hydration without the inherits4 TypeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, react, typescript, vite
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100