We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm having trouble using react-pdf to show a pdf file.
My application uses Node v20, Vite 5, Typescript and React.
Just adding the <Document> component on my page breaks the whole application and I get an error in the browsers console that goes.
<Document>
Uncaught TypeError: Cannot convert object to primitive value
The application won't break completely using react-pdf components.
Application breaks an I get the error
This seems to only happen when running the code in Vite in development mode
The text was updated successfully, but these errors were encountered:
In the browsers console it points out to util.js row 23 typeof process === "object" &&
util.js
typeof process === "object" &&
Sorry, something went wrong.
I found a workaround by adding the following code to my vite.config.ts. Though I do think maybe this should be handled in react-pdf.
define: { process: JSON.stringify({}), },
No branches or pull requests
Before you start - checklist
Description
I'm having trouble using react-pdf to show a pdf file.
My application uses Node v20, Vite 5, Typescript and React.
Just adding the
<Document>
component on my page breaks the whole application and I get an error in the browsers console that goes.Uncaught TypeError: Cannot convert object to primitive value
Steps to reproduce
<Document>
component to in your React applicationExpected behavior
The application won't break completely using react-pdf components.
Actual behavior
Application breaks an I get the error
Uncaught TypeError: Cannot convert object to primitive value
Additional information
This seems to only happen when running the code in Vite in development mode
Environment
The text was updated successfully, but these errors were encountered: