1

I'm setting up a new Next.js 13 project with the following folder structure:

- app
  - blog
    - page.jsx

I also have another page in the blog directory called test.jsx. However, when I try to access it using "localhost:3000/blog/test" or any other component name, I receive a 404 error.

How can I correctly reach the test.jsx page in my Next.js project?

2
  • Please provide enough code so others can better understand or reproduce the problem. Commented Aug 30, 2023 at 14:40
  • Hi Taha1! Have you checked the below answer? Let us know please :) Commented Sep 2, 2023 at 15:16

1 Answer 1

0

With the app directory (router), to have a /blog/test route, you need to create a test folder inside blog, inside which you add a page.tsx file, which will contain the content of your current test.tsx file (leading to app/blog/test/page.tsx).

For a more detailed answer, checkout this thread.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.