Next.js Discord

Discord Forum

All routes lead to 404

Answered
Yacare Caiman posted this in #help-forum
Open in Discord
Avatar
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
Image
Answered by Z4NR34L
checkout to new branch and push them, I will take a look at them as they are now ;p
View full answer

43 Replies

Avatar
Yacare CaimanOP
Image
Avatar
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.
Avatar
Yacare CaimanOP
Sorry about that, was also working on something
Avatar
perfect, so now I need a few seconds to take a look at it 😄
Avatar
Yacare CaimanOP
yay!
Avatar
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
Avatar
Yacare CaimanOP
:fine:
eh?
Avatar
Image
just installed deps and ran next dev 😉
Avatar
Yacare CaimanOP
holy shit
Image
Avatar
try in incognito
Avatar
Yacare CaimanOP
Image
Avatar
terminate dev server, run npm install and later npm run dev
Avatar
Yacare CaimanOP
same thing
Image
ayt
Avatar
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
Avatar
Yacare CaimanOP
oh yh did
the changes worked fine until like yday
Avatar
checkout to new branch and push them, I will take a look at them as they are now ;p
Answer
Avatar
just let me know the branch name with your current code which have problems
Avatar
Yacare CaimanOP
Image
LMAO
I dunno why but it works now on the changes branch
this error though is something else
Avatar
you not defined 'use client' in component that uses state
Avatar
Yacare CaimanOP
Image
oh yh i forgot
Avatar
headers cant be used in client components 😉
Avatar
Yacare CaimanOP
yh i know
not even sure how to handle that
Avatar
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 😉
Avatar
Yacare CaimanOP
ok
Avatar
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)