Reputation: 11
default router is not working even though when i use correct folder structure in version 13.5.4 next Js.
Simply i created the new project using the command like npx create-next-app@latest project name and inside the App folder created the folder called user.Inside the user folder created the about.js file.but it shows the 404 page when i use the url (http://localhost:3000/user) I don't know why?.
Upvotes: 1
Views: 489
Reputation: 58142
When using the "app folder" for Next, your pages need to be actually called "page.js" (or "page.jsx" or "page.tsx")
So if you wanted to access the user page at localhost:3000/user
, your directory structure should be:
app/
user/
page.js
Reference: https://nextjs.org/docs/app/api-reference/functions/use-search-params
Upvotes: 1