Skip to content
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

Open
JacobWeisenburger opened this issue Nov 24, 2024 · 9 comments · Fixed by #2983
Open

TypeError: qo is not a function #2978

JacobWeisenburger opened this issue Nov 24, 2024 · 9 comments · Fixed by #2983

Comments

@JacobWeisenburger
Copy link

Every time I save I get this error: TypeError: qo is not a function

image

Then I have to reload the page and everything works again until I save again.


Here's the full error stack.

TypeError: qo is not a function
    at ml (http://localhost:3000/_next/static/chunks/node_modules_@react-pdf_reconciler_lib_cdf250._.js:3425:155)
    at Ol (http://localhost:3000/_next/static/chunks/node_modules_@react-pdf_reconciler_lib_cdf250._.js:3917:25)
    at Ml (http://localhost:3000/_next/static/chunks/node_modules_@react-pdf_reconciler_lib_cdf250._.js:3845:29)
    at Hl (http://localhost:3000/_next/static/chunks/node_modules_@react-pdf_reconciler_lib_cdf250._.js:3860:21)
    at ga (http://localhost:3000/_next/static/chunks/node_modules_@react-pdf_reconciler_lib_cdf250._.js:4428:35)
    at http://localhost:3000/_next/static/chunks/node_modules_@react-pdf_reconciler_lib_cdf250._.js:4395:38
    at pa (http://localhost:3000/_next/static/chunks/node_modules_@react-pdf_reconciler_lib_cdf250._.js:4396:18)
    at Yl (http://localhost:3000/_next/static/chunks/node_modules_@react-pdf_reconciler_lib_cdf250._.js:4109:13)
    at $l (http://localhost:3000/_next/static/chunks/node_modules_@react-pdf_reconciler_lib_cdf250._.js:4096:29)
    at Re (http://localhost:3000/_next/static/chunks/node_modules_@react-pdf_reconciler_lib_cdf250._.js:916:31)
    at Ce (http://localhost:3000/_next/static/chunks/node_modules_@react-pdf_reconciler_lib_cdf250._.js:866:92)
    at Ya.flushSyncWork (http://localhost:3000/_next/static/chunks/node_modules_@react-pdf_reconciler_lib_cdf250._.js:5540:48)
    at Object.updateContainer (http://localhost:3000/_next/static/chunks/node_modules_@react-pdf_reconciler_lib_cdf250._.js:5614:50)
    at Object.updateContainer (http://localhost:3000/_next/static/chunks/node_modules_ea10b4._.js:19011:18)
    at usePDF.useCallback[update] (http://localhost:3000/_next/static/chunks/node_modules_ea10b4._.js:19220:33)
    at PDFViewer.useEffect (http://localhost:3000/_next/static/chunks/node_modules_ea10b4._.js:19232:36)
    at react-stack-bottom-frame (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:12439:22)
    at runWithFiberInDEV (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:631:20)
    at commitHookEffectListMount (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:5817:628)
    at commitHookPassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:5852:60)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6756:33)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6755:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6755:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6755:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6789:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6789:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6755:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6789:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6755:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6755:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6755:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6755:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6789:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6755:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6755:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
@AtheerAPeter
Copy link

same here, happening since i updated to next 15

@JacobWeisenburger
Copy link
Author

JacobWeisenburger commented Nov 26, 2024

Still getting the same error after updating to @react-pdf/renderer: 4.1.5

image


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

TypeError: qo is not a function
    at ml (http://localhost:3000/_next/static/chunks/9037f_@react-pdf_reconciler_lib_3be79f._.js:3425:155)
    at Ol (http://localhost:3000/_next/static/chunks/9037f_@react-pdf_reconciler_lib_3be79f._.js:3917:25)
    at Ml (http://localhost:3000/_next/static/chunks/9037f_@react-pdf_reconciler_lib_3be79f._.js:3845:29)
    at Hl (http://localhost:3000/_next/static/chunks/9037f_@react-pdf_reconciler_lib_3be79f._.js:3860:21)
    at ga (http://localhost:3000/_next/static/chunks/9037f_@react-pdf_reconciler_lib_3be79f._.js:4428:35)
    at http://localhost:3000/_next/static/chunks/9037f_@react-pdf_reconciler_lib_3be79f._.js:4395:38
    at pa (http://localhost:3000/_next/static/chunks/9037f_@react-pdf_reconciler_lib_3be79f._.js:4396:18)
    at Yl (http://localhost:3000/_next/static/chunks/9037f_@react-pdf_reconciler_lib_3be79f._.js:4109:13)
    at $l (http://localhost:3000/_next/static/chunks/9037f_@react-pdf_reconciler_lib_3be79f._.js:4096:29)
    at Re (http://localhost:3000/_next/static/chunks/9037f_@react-pdf_reconciler_lib_3be79f._.js:916:31)
    at Ce (http://localhost:3000/_next/static/chunks/9037f_@react-pdf_reconciler_lib_3be79f._.js:866:92)
    at Ya.flushSyncWork (http://localhost:3000/_next/static/chunks/9037f_@react-pdf_reconciler_lib_3be79f._.js:5540:48)
    at Object.updateContainer (http://localhost:3000/_next/static/chunks/9037f_@react-pdf_reconciler_lib_3be79f._.js:5614:50)
    at Object.updateContainer (http://localhost:3000/_next/static/chunks/node_modules_efa1a4._.js:19011:18)
    at usePDF.useCallback[update] (http://localhost:3000/_next/static/chunks/node_modules_efa1a4._.js:19220:33)
    at PDFViewer.useEffect (http://localhost:3000/_next/static/chunks/node_modules_efa1a4._.js:19232:36)
    at react-stack-bottom-frame (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:12439:22)
    at runWithFiberInDEV (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:631:20)
    at commitHookEffectListMount (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:5817:628)
    at commitHookPassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:5852:60)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6756:33)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6755:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6755:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6755:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6789:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6789:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6755:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6789:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6755:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6755:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6755:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6755:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6789:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6755:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)
    at commitPassiveMountOnFiber (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6755:17)
    at recursivelyTraversePassiveMountEffects (http://localhost:3000/_next/static/chunks/node_modules_next_dist_compiled_react-dom_1f56dc._.js:6747:106)

@diegomura diegomura reopened this Nov 26, 2024
@diegomura
Copy link
Owner

Thanks. I reopened this. I'll investigate as soon as I can

@evertjr
Copy link

evertjr commented Nov 27, 2024

I'm getting this error too on Next 15. Any idea what triggers this and there's any workaround?

@pironti
Copy link

pironti commented Nov 28, 2024

Same here using next 15 with react 19. Any ideias?

@vishnut2003
Copy link

This error is because of change in state. I fixed it by doing conditional rendering.

@evertjr
Copy link

evertjr commented Dec 2, 2024

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

@JacobWeisenburger
Copy link
Author

This error is because of change in state. I fixed it by doing conditional rendering.

Could you and a code example of what you mean?

@alanhaertel
Copy link

alanhaertel commented Dec 11, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants