Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Adding new pages

I’m new with Next js, and I’m adding a new page, I just create a folder pages inside of src/app, then I add file dashboard.tsx but when I try to go to http://localhost:3000/dashboard I have this issue:

404 | This page could not be found.

why??

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

enter image description here

>Solution :

The root file of a directory is index.tsx

Edit

As pointed out by another answer, you are using Next 13 and the app folder feature.

The page you are aiming to create should be app/dashboard/index.tsx

(not as previously mentioned pages/dashboard/index.tsx — which however would apply if you are pre-Next 13 or are opting out of the app folder)

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading