Next.js Discord

Discord Forum

mysterious 404 page

Answered
Brouillard posted this in #help-forum
Open in Discord
this is my app/page.tsx

I don't understand why but it gives me a 404 :

import prisma from '@/app/utils/prismaClient'
import { Button } from '@/components/ui/button'

export default async function Home() {
  async function fetchCampagne() {
    'use server'
    const campagne = await prisma.campagne.findUnique({
      where: {
        id: Number(1)
      },
      include: {
        personnages: true
      }
    })
    return campagne
  }
  const compi = await fetchCampagne()


  return (
    <div>
      <Button> HOO </Button>
      {
        compi?.personnages?.length && (
          compi.personnages.map((personnage) => {
            return (
              <Button key={personnage.id} >
                {personnage.name}
              </Button>
            )
          })
        )
      }
    </div>
  )
}
Answered by Ray
if you have app folder in root directory, the one in src will be ignored
View full answer

8 Replies

I tried reverting it to a simple page but I still got the error
help
Siberian Flycatcher
Hi 👋
Do you have your code on github?
I just pushed it with the bug
if you have app folder in root directory, the one in src will be ignored
Answer
Damn ! thanks a lot !
I think it is when I installed shadcn it put this here when initialized