How load render a PDF using react-pdf #3065
Unanswered
charklewis
asked this question in
Q&A
Replies: 2 comments
-
Do you have a sample repo available? |
Beta Was this translation helpful? Give feedback.
0 replies
-
https://stackoverflow.com/questions/70642314/is-there-a-way-to-generate-pdf-with-remix-run |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am struggling loading a PDF using the popular react-pdf library. I keep running into the below error.
I have read the "gotcha" part of the docs that explain this issue but I don't think it is relevant there isn't any "server" specific code the tis being loaded in the client module. Any import (eg
Document
) fromreact-pdf
throws this error. If I try to load it only on the server I get the error:I have tried to only load the component on the client (using .client.tsx and
ClientOnly
fromremix-utils
), but the error still persists. I have also tried the suggestion on this issue but it also continues to fail.I have also tried to follow the examples provided in their docs for esbuild, and I am able to progress further. It does load the "Loading PDF..." text. However when the page loads it continues to error with the same message. When this error occurs, the app is also unresponsive (ie no javascript works).
Any tips would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions