Next.js Discord

Discord Forum

error about using async/await while using react-pdf

Answered
Arthur posted this in #help-forum
Open in Discord
Uncaught Error: async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.
    trackUsedThenable react-dom.development.js:8537
    unwrapThenable react-dom.development.js:8708
    reconcileChildFibersImpl react-dom.development.js:9792
    reconcileChildFibers react-dom.development.js:9821
    reconcileChildren react-dom.development.js:15515
    mountIndeterminateComponent react-dom.development.js:16739
    beginWork$1 react-dom.development.js:18254


Got this error using (react-pdf)
Answered by riský
the component is what was meant... not any async function
View full answer

14 Replies

in the "use server" file
using in the "use client" file
Persian
Use client don’t support async
huh
I use async in other files too
it works there
this file has "use client"
and works
the component is what was meant... not any async function
Answer
ahhh
dumb mistake
thanks patrick