Next.js Discord

Discord Forum

Something's really off..

Answered
6vz posted this in #help-forum
Open in Discord
Avatar
6vzOP
So... I get this error about using await/async. It is caused by node_modules/next/dist/compiled/react-dom/cjs/react-dom.development.js . This happens after using useState() and TextField with [MUI](https://mui.com).

The best part? I was doing EXACTLY SAME THING 1 week ago, and it was working without any notices, but now, it just stopped.

Can please someone help me with my issue? I can share code that causes this error, on request.
Image
Answered by Jboncz
Remove your navbar client from the code.
View full answer

36 Replies

Avatar
6vzOP
NOTE: I DO NOT HAVE ANY ASYNC IN MY CODE!
Avatar
You cant use useState() inside of a server component? Share your code if you want assistance.
Avatar
6vzOP
Sorry for long response time
Image
Here's the code.
Avatar
No problem.
So what you have shown me here looks fine. Can you provide me with the stack trace for the error your getting?
Avatar
6vzOP
Let me boot it up.
Avatar
also if you do 3 backticks then type 'js' then go to next line and put your code itll do proper syntax highlighting just a tip 🙂
Avatar
6vzOP
Image
Avatar
const you = 'abc123'
Avatar
6vzOP
I know, but since Discord converts longer messages to files, there was nothing i could do
Avatar
Can you give me the error from the console instead of the screenshot here?
Ahhhhh, I gotcha
Avatar
6vzOP
This error for some reason does not appear in console.
Image
Avatar
Hmmm, okay. interesting.
Avatar
6vzOP
This is very weird, since they tell me that I am using async/await statements
Image
Avatar
Remove your navbar client from the code.
Answer
Avatar
and try again
only thing thats 'custom' just want to rule it out
also are you using turbo?
Avatar
6vzOP
No, should I?
Oh my goood...
Avatar
Nope, not when troubleshooting, just wanted to makesure your not.
Avatar
6vzOP
Let's just say that.
Avatar
🙂
Avatar
6vzOP
it works
Avatar
Glad to help!
Was it the navbar?
Avatar
6vzOP
yeah, i was having async in the navbar
tho it should say at least something that it was in the navbar
Avatar
Ye heheh. stack trace leaves something to be desired for sure.
Avatar
6vzOP
Thank you for helping me out with it
Avatar
Weird it didnt appear on the console, ussually it appears both client side and server side. Anyways, GL!