Next.js Discord

Discord Forum

Cant build on Server deployment

Answered
Munchkin posted this in #help-forum
Open in Discord
MunchkinOP
As the message says. I currently run my site on vercel, but recently i bought a server and i would like to move my project there.
Now when i try to build on that server it gives me this error log.

Not sure what caused this and im not really getting any wiser by the error messages
Answered by Munchkin
Managed to fix my issue. I forgot to add my .env file
View full answer

3 Replies

You need to show some code.

Maybe start with the /characterpage/page.tsx
Holland Lop
You are calling replace on undefined, you can fix this by checking if variable is an string and then call replace, something like this:
let var = 'str';
if(var && var.replace) var.replace('x','y')
MunchkinOP
Managed to fix my issue. I forgot to add my .env file
Answer