Open wkigenyi opened 1 week ago
This PR updates the package for react 19 (https://github.com/diegomura/react-pdf/pull/2783). You could temporarily use the forked package to get it working now @alexandernanberg/react-pdf-renderer
Thanks I will try it.
This PR updates the package for react 19 (https://github.com/diegomura/react-pdf/pull/2783). You could temporarily use the forked package to get it working now
@alexandernanberg/react-pdf-renderer
I have forked your repo. But for some reason the cloning process timeouts before completing. If I succeed with the cloning, could guide me on how I can import the package into my react project?
This PR updates the package for react 19 (#2783). You could temporarily use the forked package to get it working now
@alexandernanberg/react-pdf-renderer
I have forked your repo. But for some reason the cloning process timeouts before completing. If I succeed with the cloning, could guide me on how I can import the package into my react project?
@wkigenyi The easiest way would be to just install @alexandernanberg/react-pdf-renderer
and simply replace any of the imports to use that instead
Thank you.
Does @alexandernanberg/react-pdf-renderer
support Nextjs 15
?
Yes it does
Have any of you guys run into this issue? @ck-euan @wkigenyi
details: @alexandernanberg/react-pdf-renderer@4.0.0-canary-3 next@15.0.2
Error:
⨯ TypeError: Cannot read properties of undefined (reading 'S')
@pedro757 Yeah I just ran into that issue.
I believe that the PR needs to be updated with newer versions of react
, react-dom
and react-reconciler
.
I was able to solve it by patching @react-pdf/renderer
.
Basically I just copied all of the changes made in https://github.com/diegomura/react-pdf/pull/2783 but I updated the versions to the following:
react: 19.0.0-rc-02c0e824-20241028
react-dom: 19.0.0-rc-02c0e824-20241028
react-reconciler: 0.31.0-rc-02c0e824-20241028
Specifically, the exact steps I took to do this were:
react
, react-dom
and react-reconciler
to their latest rc
versionsyarn build
to build the @react-pdf/renderer
packages locally, this gives you the lib
folder. We will need to copy this for our patch.pnpm patch @react-pdf/renderer@4.0.0
however you can do the same with patch package if you don't use pnpmlib
folder from @react-pdf/renderer
with the new one I built locally.pnpm patch-commit ...
It then started to work for me. I really hope react 19 stable release happens soon 😅
Yes it does
No, it's doesn't work with nextjs 15
and react 19
. I get this error now
@wkigenyi
⨯ TypeError: Cannot read properties of undefined (reading 'S')
at module.exports (.next/server/chunks/08b5e_@alexandernanberg_react-pdf-renderer_lib_react-pdf_1362ba.js:14494:67)
at createRenderer (.next/server/chunks/08b5e_@alexandernanberg_react-pdf-renderer_lib_react-pdf_1362ba.js:14980:12)
at pdf (/.next/server/chunks/08b5e_@alexandernanberg_react-pdf-renderer_lib_react-pdf_1362ba.js:15180:28)
at renderToStream (/.next/server/chunks/08b5e_@alexandernanberg_react-pdf-renderer_lib_react-pdf_1362ba.js:15311:22)
It worked for me and still works. How did you install yours?
@wkigenyi is there any chance you could share your package.json and lockfile?
This good pointer. I have remembered that I actually have 2 packages "@alexandernanberg/react-pdf-renderer": "4.0.0-canary-3" and "@react-pdf/renderer": "^4.0.0". I imported the PDFDownloadLink from "@alexander..." the components and other functions from "@react-pdf/renderer"
@alexandernanberg/react-pdf-renderer
Installed using pnpm add @alexandernanberg/react-pdf-renderer
. Got this in my package.json
"@alexandernanberg/react-pdf-renderer": "4.0.0-canary-3",
i'm server rendering, so i'm using renderToStream
Specifically, the exact steps I took to do this were:
Thank you @ck-euan !, That works, good workaround.
This good pointer. I have remembered that I actually have 2 packages "@alexandernanberg/react-pdf-renderer": "4.0.0-canary-3" and "@react-pdf/renderer": "^4.0.0". I imported the PDFDownloadLink from "@alexander..." the components and other functions from "@react-pdf/renderer"
@sam3d did this work for you ?
@ck-euan I sometimes run into this error on re-rendering TypeError: detachDeletedInstance is not a function
Hi,
Thanks for the wonderful library. It works well with <= React v18. Is there a plan to support React 19?