No async eventhoug its a server component
Unanswered
Kromfohrländer posted this in #help-forum
KromfohrländerOP
Hello everyone, can someone explain to me why I get an error in my browser saying
Async not avaible yet for client component etc etc... but I have not defined it as a use client . I hope I am making sense with my question. There is one thing that maybe is causing the issue, this component is being used in an other component which is a 'use client' component. Can someone tell me if that is the issue?2 Replies
American Crow
Yes you are right the problem is the client component importing it.
Importing another component from a client component makes it a client component. Even if you don't mark it as such with "use client". You can console log to test it and check if the log appears in the server terminal or browser console.
If you want better error messages (like which component is wrongly importing) and/or make sure that your functions only run on the server you can install the package
Importing another component from a client component makes it a client component. Even if you don't mark it as such with "use client". You can console log to test it and check if the log appears in the server terminal or browser console.
If you want better error messages (like which component is wrongly importing) and/or make sure that your functions only run on the server you can install the package
server-only and mark files using "server-only" at the top of your file// Edit:
To solve your problem you have to pass the ChooseTreatment component through as
To solve your problem you have to pass the ChooseTreatment component through as
children