Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 error on homepage when deploying on Vercel, no page available in source after build process #49543

Closed
1 task done
lionelrudaz opened this issue May 9, 2023 · 2 comments
Labels
area: app App directory (appDir: true) bug Issue was opened via the bug report template.

Comments

@lionelrudaz
Copy link

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 22.4.0: Mon Mar  6 21:01:02 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T8112
    Binaries:
      Node: 19.1.0
      npm: 8.19.3
      Yarn: 3.3.0
      pnpm: 8.4.0
    Relevant packages:
      next: 13.4.2-canary.3
      eslint-config-next: 13.0.7
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 4.8.4

Which area(s) of Next.js are affected? (leave empty if unsure)

App directory (appDir: true)

Link to the code that reproduces this issue

https://github.com/lionelrudaz/tasters/tree/app-router

To Reproduce

Hey folks,

I'm migrating my app from the /pages to the /app router.

Everything is going smoothly so far, up to the point that I'm trying to migrate the home page. I've created a page.tsx file in the /app directory, everything is pervect locally. The build retrieves no error and shows the / page as a static page

CleanShot 2023-05-09 at 20 04 37@2x

When I deploy on Vercel, all routes work, except the homepage, which raises a 404 error.

I've checked the build, there's no / page.

CleanShot 2023-05-09 at 20 04 58@2x

I've checked the outcome source. there's no index page.

CleanShot 2023-05-09 at 20 05 32@2x

Here's the structure of my /app folder

CleanShot 2023-05-09 at 20 16 01@2x

Describe the Bug

Exploained in the steps to reproduce

Expected Behavior

The homepage should work and not retrieve a 404 error 😅

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

Vercel with Github

@lionelrudaz lionelrudaz added the bug Issue was opened via the bug report template. label May 9, 2023
@github-actions github-actions bot added the area: app App directory (appDir: true) label May 9, 2023
@lionelrudaz lionelrudaz changed the title 404 error on homepage when deploying on Vercel 404 error on homepage when deploying on Vercel, no page available in source after build process May 10, 2023
@lionelrudaz
Copy link
Author

I've found the error. My PageComponent.tsx file was originally named Page.tsx. When I renamed it to create page.tsx for the homepage, GitHub thought it was the same file.

I had to run git mv Page.tsx page.tsx and voilà.

Hope this is helpful for n00bs like me 😅

@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: app App directory (appDir: true) bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

1 participant