Next.js Discord

Discord Forum

Failed to collect page data for /_not-found

Unanswered
Oriental posted this in #help-forum
Open in Discord
OrientalOP
Hi, I am getting this error and do not know how I can fix it

17 Replies

@Oriental Hi, I am getting this error and do not know how I can fix it
how does your not-found.tsx file look like
OrientalOP
export default function NotFound() {
  return (
    <div>
      <h1>404 - Not Found</h1>
    </div>
  );
}
OrientalOP
Yeah there's no bugs when I run it with vercel dev
OrientalOP
The error only occurs when I try to deploy to prod
@Oriental Yeah there's no bugs when I run it with `vercel dev`
what about vercel build
OrientalOP
After running vercel build it says the build completed successfully
OrientalOP
What do you think I should try next?
@Oriental What do you think I should try next?
remove your 404 page
and try building again
OrientalOP
Ok
It also builds successfully after removing the 404 page
OrientalOP
What should I try now?
Any chance you could throw up a basic example on Git? I can take a look
OrientalOP
I figured out the problem
@Oriental What did it end up being?
@Oriental I figured out the problem
Hello, how you fixed it? Im facing the same problem with bunch of pages