Can't use "@react-pdf/renderer" client side in the RC
After updating to RC, it's no longer possible to use
"@react-pdf/renderer" in the client-side; we receive this error directly when visiting the page that uses it:
To reproduce:
Maybe the problem comes from "@react-pdf/renderer" but in version ^1.131 it worked pretty well14 Replies
united-yellow•2mo ago
add
@react-pdf/renderer to ssr.noExternal in the vite configconscious-sapphireOP•2mo ago
Oh thanks I'll try that
This didn't work for me, I migrated PDF generation to server side
united-yellow•2mo ago
what happened with this setting?
conscious-sapphireOP•2mo ago
same issue
Oh! I just tested with
@tanstack/nitro-v2-vite-plugin it works, but with nitro-nightly it doesn't workunited-yellow•2mo ago
and with nitro3 alpha ( not nightly)?
conscious-sapphireOP•2mo ago
I hadn't seen the new update of the doc, I just tested it now and still the same error message:
With
@tanstack/nitro-v2-vite-plugin it seems to work fine now, even without ssr.noExternal config, (I think there was a conflict with the dependencies because before I had both versions of Nitro installed at the same time)united-yellow•2mo ago
might be worth raising this issue at nitro then
either it's a bug or a misconfiguration
conscious-sapphireOP•2mo ago
Yes I will report that, the problem is that with Nitro there is also Bcrypt which did not work in the build so I downgraded to v2 which works much better, thank you I will report these two problems to Nitro
united-yellow•2mo ago
ideally you can reproduce them in a pure nitro project, wihout start
united-yellow•2mo ago
GitHub
vite-examples/examples/react-ssr at main · nitrojs/vite-examples
Nitro v3 + Vite Examples. Contribute to nitrojs/vite-examples development by creating an account on GitHub.
conscious-sapphireOP•2mo ago
Oh thank you!
united-yellow•2mo ago
this might have just been fixed here
united-yellow•2mo ago
GitHub
fix(vite): remove
noExternal: true from service environment build...🔗 Linked issue
I think this can be removed from each service build since final nitro environment has noExternal: true, which can take care bundling up dependencies. Currently it's causing ...
conscious-sapphireOP•2mo ago
sorry didn't really understand, I just tested with the
react-ssr example, and indeed I have the same error message, and therefore the same bug. so i can report this issue to Nitro