-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
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
TypeError: qo is not a function #2978
Comments
same here, happening since i updated to next 15 |
Still getting the same error after updating to the code I'm using to test this'use client'
import { Document, Page, PDFViewer, StyleSheet, Text, View } from '@react-pdf/renderer'
export default function Home () {
return <PDFViewer {...{
style: {
width: '100dvw',
height: '100dvh',
},
}}>
<MyDocument />
</PDFViewer>
}
function MyDocument () {
const styles = StyleSheet.create( {
page: {
flexDirection: 'row',
// backgroundColor: '#E4E4E4',
},
section: {
margin: 10,
padding: 10,
flexGrow: 1,
},
} )
return <Document>
<Page size='A4' style={styles.page}>
<View style={styles.section}>
<Text>Section #1</Text>
</View>
<View style={styles.section}>
<Text>Section #2</Text>
</View>
</Page>
</Document>
} dependencies"dependencies": {
"@react-pdf/renderer": "^4.1.5",
"next": "15.0.3",
"react": "19.0.0-rc-66855b96-20241106",
"react-dom": "19.0.0-rc-66855b96-20241106"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"postcss": "^8",
"tailwindcss": "^3.4.1",
"typescript": "^5"
} full error stack
|
Thanks. I reopened this. I'll investigate as soon as I can |
I'm getting this error too on Next 15. Any idea what triggers this and there's any workaround? |
Same here using next 15 with react 19. Any ideias? |
This error is because of change in state. I fixed it by doing conditional rendering. |
I downgraded the project to Next 14 in the meantime and it stoped the problem, so it is clearly some incompatibility with Next 15 / React 19 |
Could you and a code example of what you mean? |
Same error here. Using NextJS 15.1.0 with stable React 19 version and @react-pdf/renderer: 4.1.5 Edit: Im using the PDFDownloadLink component and mapping data into rows. I encountered this issue when storing the data in a useState. I switched to using Nanostores for state management, and it works fine now. It seems there is a compatibility issue between the library and React's internal state management |
Hello everybody ! I'm facing this problem too. Is there any solution to this problem ?
@vishnut2003 Can you please provide a example ? Here is my package.json:
|
This worked for me: typeof window !== 'undefined' && ( // Only render on client side
<PDFViewer width="100%" height="100%">
<ResumePDF data={data} />
</PDFViewer>
)} |
Hello @kanarian, thanks for your answer but it didn't helped me. I solved the problem by importing PDFViewer dynamically in order to prevent module to be imported on server side : https://nextjs.org/docs/pages/building-your-application/optimizing/lazy-loading#nextdynamic PDFViewer.tsx :
page.tsx :
Hope this will help ! |
The same error occurs in vite js: TypeError: qo is not a function The above error occurred in the component. React will try to recreate this component tree from scratch using the error boundary you provided, CatchBoundaryImpl. defaultOnCaughtError @ react-dom_client.js?v=0b4fceb0:5613 |
I recreated the issue here So, What I'm trying to do here is to render based on the selected template. But as soon as I change the template I get this error. |
Bump, this is an issue for us too |
This is also an issue for me. I am using |
I have nextJS 15 and react 19.
|
This works without any issues. Thank you for sharing! |
I tried it and it solves the issue, but you need to set |
@michel-jump Here is how I "fixed it": #2888 (comment) |
You're right, i had issue too. Remove loose from my nextjs config (turbo pack doesn't support it) I create a file pdfViewer.tsx with only these line :
Then I create a new file Exemple.tsx and import it as follow :
The following path "../testpdf/pdfViewer" is where is your pdfViewer.tsx |
Yeah, that's the linting part, but the |
Oh right my bad, read through it too quickly. Had the same issue. I ended up removing the download button... |
Craziest thing is: I had that solution implemented before my first comment here.. It consistently gave me the error. |
ha ha ha, i do understand ! Did you try to do a very simple document PDF for the begining ? |
Every time I save I get this error:
TypeError: qo is not a function
Then I have to reload the page and everything works again until I save again.
Here's the full error stack.
The text was updated successfully, but these errors were encountered: