Next.js Discord

Discord Forum

routes not working?

Answered
Oriental posted this in #help-forum
Open in Discord
Original message was deleted.

15 Replies

Avatar
Mud-daubers
add page.tsx to the folder "pages"
localhost:3000/pages will look for a page.tsx file. If found it renders.
or just rename discordserver.tsx to page.tsx
what's inside page.tsx
Avatar
the pages folder is supposed to be outside of app folder
and OP's original file naming is correct
why are you using pages dir anyways?
app dir and pages dir are different things, since next 13 it's recommended to use app dir
Original message was deleted
Avatar
Mud-daubers
can i see it?
and rename the pages folder to something else. I think it is a keyword not sure tho
Avatar
no, default template won't have pages dir inside the app dir
if you want to create a page. the file structure is: app/pagename/page.tsx
Answer