Next.js Discord

Discord Forum

404 page not showing

Answered
Sckab posted this in #help-forum
Open in Discord
i have made this file here:
// src/app/[lang]/not-found.tsx 
export default async function NotFound(props: {
  params: Promise<{
    lang: locales
  }>
}) {
  const { lang } = await props.params
  const dictionary = await getDictionary(lang)
  const error = dictionary.errors[404]

  return (
    <div className='h-screen w-screen bg-stone-100 dark:bg-stone-900'>
      <span className='text-5xl text-blue-400 dark:text-blue-300'>404</span>
      <span className='text-xl'>{error.title}</span>
      <LinkHero
        link={`/${lang}`}
        external={true}
        fill={true}
      >
        {error.links.guide}
      </LinkHero>
    </div>
  )
}

but it isn't showing
Answered by Sckab
i fixed it by creating a global-not-found.tsx
View full answer

5 Replies