Whenever I wrap my root in nextuiprovider code breaks
Unanswered
Sloth bear posted this in #help-forum
Sloth bearOP
Whenever I wrap my root in the nextui provider it throws use client error. I cant use the client though because its a root file containing metadata which only runs on server. I dont know whats going on here so any help would be great.
99 Replies
@Sloth bear Whenever I wrap my root in the nextui provider it throws use client error. I cant use the client though because its a root file containing metadata which only runs on server. I dont know whats going on here so any help would be great.
Yellowstripe scad
I had this problem also, I completely dont use next-ui anymore, I use shadcn/ui, but I think you need to put the provider around each component you use it in. Im not really sure
lmk if that doesnt work
@Yellowstripe scad lmk if that doesnt work
Sloth bearOP
this is what happens when I wrap the component
When I watch all the youtube vids it just works
Yellowstripe scad
hmm
Sloth bearOP
idk if its an update that broke it or what but its def broke
Yellowstripe scad
my first suggestion is to just use this instead
@Yellowstripe scad https://ui.shadcn.com/docs/components/table
Sloth bearOP
okay
I will give it a try
Yellowstripe scad
I mean are there components shadcn ui doesnt have
that you like
@Yellowstripe scad I mean are there components shadcn ui doesnt have
Sloth bearOP
nah I just mainly need a table for my prject
its going to be like a journal
Yellowstripe scad
oh lmao, is that the only reason you're using next-auth
@Sloth bear its going to be like a journal
Yellowstripe scad
thats cool
@Yellowstripe scad oh lmao, is that the only reason you're using next-auth
Sloth bearOP
yea its just easier to do everything in next js
@Sloth bear yea its just easier to do everything in next js
Yellowstripe scad
oops sorry I keep talking about other things, I meant next-ui
@Yellowstripe scad oops sorry I keep talking about other things, I meant next-ui
Sloth bearOP
I was using next ui cause I like the look of everything and the animations are nice but I cant even get the damn thing to import componets and there are no vids about it
so fuck it
Yellowstripe scad
thats true, it also does have a bit more things to shadcn and looks a bit nicer imo but shadcn is really easy to use because it just adds a component file instead of being a library
that way you can easily edit each component yourself if needed
@Yellowstripe scad that way you can easily edit each component yourself if needed
Sloth bearOP
yea I would rather that 100% more
Yellowstripe scad
you can easily change the classNames
Sloth bearOP
damn I have to tap into this shit 😄
@Sloth bear damn I have to tap into this shit 😄
Yellowstripe scad
lmk if you need any help with shadcn/ui, although I'm pretty new to nextjs myself
@Yellowstripe scad lmk if you need any help with shadcn/ui, although I'm pretty new to nextjs myself
Sloth bearOP
yea I got a question
wtf is this?
its always an up hill battle with these damn libraries
lmao
Yellowstripe scad
you dont have a package.json?
file
wait you do
Sloth bearOP
I do but its not being recognized for some reason
I will try just making another project
Yellowstripe scad
yeah do that, and then do these commands
1.
npx shadcn-ui@latest init@Yellowstripe scad 1. `npx shadcn-ui@latest init`
Sloth bearOP
yea im on that page of the docs rn
Yellowstripe scad
ðŸ‘
Sloth bearOP
fresh new directory but still happening
Yellowstripe scad
try
cd my-app
then do it
@Yellowstripe scad cd my-app
Sloth bearOP
I FUCKING HATE THE TERMINAL
its worked.
Yellowstripe scad
lol dw
all g
I make the stupidest mistakes like that too
Sloth bearOP
thanks â¤ï¸
Yellowstripe scad
no problem
Sloth bearOP
its worked
now I gotta edit it
@Sloth bear now I gotta edit it
Yellowstripe scad
I would try changing outside the component before going into it if yk what I mean
@Sloth bear wdym?
Yellowstripe scad
like I said you could edit inside the component file, but I'd try to manipulate it by adding divs and classnames to the imported component before editing the inside
Sloth bearOP
hey @Yellowstripe scad
have you encounterd this error?
all I am doing is copy pasting code from shadcn docs
@Sloth bear Click to see attachment
Yellowstripe scad
make it export default function instead of export function
@Yellowstripe scad make it export default function instead of export function
Sloth bearOP
IT WORKED. Thanks so much im still trying to get the hang of nextjs â¤ï¸
@Sloth bear IT WORKED. Thanks so much im still trying to get the hang of nextjs â¤ï¸
Yellowstripe scad
no problem, im relatively new also. about a month and a half in 💪
@Yellowstripe scad no problem, im relatively new also. about a month and a half in 💪
Sloth bearOP
damn your a pro compared to me ðŸ˜
Yellowstripe scad
nah man its a bunch of trial and error. I started making a site about a month and a half ago and I kept running into problems noone had
I stopped coding for two weeks and since then I've recreated my site again with no errors I dont understand
@Yellowstripe scad I stopped coding for two weeks and since then I've recreated my site again with no errors I dont understand
Sloth bearOP
damn I wish I could be like you
hopefully one day
Yellowstripe scad
whattt
this is my first time ever with nextjs, typescript, javascript even
you must just be good with it
naturaly
Yellowstripe scad
lmao, im not. I only figured out <Suspense /> today
I had to get someone in my family to explain sql dbs to me
@Yellowstripe scad I had to get someone in my family to explain sql dbs to me
Sloth bearOP
that is real dedication 😂
Yellowstripe scad
nah cause my website needed a db and mongodb prisma was too complicated for me
and i've only ever used actual mongodb
I mean I coulda done that but no really good documentation + slow
so I had to learn
relations are the worst bro
@Yellowstripe scad relations are the worst bro
Sloth bearOP
tell me about it
Yellowstripe scad
well
I figued out that reading docs isnt as bad as i thought, I used to think it was so complicated so I skipped a lot
they're really helpful, especially the code examples
Sloth bearOP
yea im trying to get into that currently
I just have one more question for now
@Yellowstripe scad
where can I learn all the class names for tailwind?
or where did you learn and what do you think is the easiest
@Sloth bear or where did you learn and what do you think is the easiest
Yellowstripe scad
lets take this into dms, we're prolly not supposed to talk about that in here