All routes lead to 404
Answered
Yacare Caiman posted this in #help-forum
Yacare CaimanOP
i recently moved a react app to nextjs on the app router using the supabase + nextjs starter. It worked fine until yesterday when none of the pages would load and even newly created ones. Ive tried building it and i have no errors but i cant generate any pages, i really dont even know where to begin to debug this kind of thing from
Answered by Z4NR34L
checkout to new branch and push them, I will take a look at them as they are now ;p
43 Replies
Yacare CaimanOP
Ok, lets simplify this: If the repository is public, please share an URL with us or prepare minimal preproduction repository. Screenshot you provided doesn't include any information about code, project structure or configuration which can be crucial in that case.
Yacare CaimanOP
Sorry about that, was also working on something
perfect, so now I need a few seconds to take a look at it 😄
Yacare CaimanOP
yay!
First thing : middleware to work should be placed inside src directory
You are facing this problem only on specific environment?
I'm not able to reproduce that issue on localhost
Yacare CaimanOP
eh?
just installed deps and ran
next dev
😉Yacare CaimanOP
holy shit
try in incognito
Yacare CaimanOP
terminate dev server, run
npm install
and later npm run dev
Yacare CaimanOP
same thing
ayt
also check what changes had you made
I'm using your main branch as it is on repository
and I see in your ZSH shell that you had some changes already 😄
if that's not your current changes - try to remove whole node_modules and reinstall them
Yacare CaimanOP
oh yh did
the changes worked fine until like yday
checkout to new branch and push them, I will take a look at them as they are now ;p
Answer
just let me know the branch name with your current code which have problems
Yacare CaimanOP
LMAO
I dunno why but it works now on the changes branch
this error though is something else
you not defined
'use client'
in component that uses stateYacare CaimanOP
oh yh i forgot
headers cant be used in client components 😉
Yacare CaimanOP
yh i know
not even sure how to handle that
I see that there is a need for "small" refactor 😄
you can use client components inside server components 😄
anyways, the problem with 404 error is solved as I see - so let's close this thread, if you will need any further assistance feel free to get in touch with me on DM 😉
Yacare CaimanOP
ok
You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)
(if you don't see the option, try refreshing Discord with Ctrl + R)