Next.js Discord

Discord Forum

Sudden error when trying to deploy to Vercel

Answered
Honzosaurus_3.1415926535 posted this in #help-forum
Open in Discord
So I just remade my simple portfolio website with NextJS and now I'm trying to deploy it to vercel, and after figuring out a few errors, I got stuck with this one, saying something about an error that occured when prerendering a page.

I have never deployed a NextJS app to vercel yet, what do I do with this?
Answered by Honzosaurus_3.1415926535
So on vercel, the domain used to host a Vite webapp, so I just had to change it to NextJS and it works just fine
View full answer

15 Replies

can you share your not-found page
@"use php" can you share your `not-found` page
import ErrorPage from "@/components/pages/Error"

export const metadata = {
  title: "Sorry, this page doesn't exist"
}

function NotFound() {
  return <ErrorPage code={404} message="Sorry, the page you're looking for could not be found." />
}

export default NotFound

https://github.com/Honzoraptor31415/PortfolioV2/blob/main/src/app/not-found.tsx
I’ll check it out tomorrow
@"use php" I’ll check it out tomorrow
Thanks a lot, really apriciate it
I checked it out, and can you npm run build locally and npm run start and see if you get this err?
I thought it might be caused by a <Link /> component being used in a client side component (the Error component), but that would not make much sense right?
Alright, so I think I fixed the prerender error, but now I'm getting a new one
Error: No Output Directory named "dist" found after the Build completed. You can configure the Output Directory in your Project Settings.
brother what
the platform
Welp, I now fugured it out
So on vercel, the domain used to host a Vite webapp, so I just had to change it to NextJS and it works just fine
Answer
thanks a lot for your time anyways!