Next.js Discord

Discord Forum

Depolying Application with getServerSideProps function

Unanswered
Bigeye tuna posted this in #help-forum
Open in Discord
Bigeye tunaOP
I want to deploy the application into a server that aleady installed node js. (cPanel). can someone tell me what are the steps that i need to fullfill. I have tried many ways. But didn't find a solution.

28 Replies

@Bigeye tuna It didn't work
what is not working?
Bigeye tunaOP
with standalone
can I know how to deploy the project in cpanel?? when I export the project, index.html file doesn't creating. It's because of the getServerSideProps() function.
Bigeye tunaOP
is it ok to upload the project withot the index.html file in the out folder??
you mean like this right?
@Bigeye tuna is it ok to upload the project withot the index.html file in the out folder??
you don't have out folder with standalone output
copy the standalone folder to your server
after build
.next/standalone
Bigeye tunaOP
Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
Error: Error for page /: pages with getServerSideProps can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export
Bigeye tunaOP
ok i'm gonna try this. thanks for guiding me dude
Bigeye tunaOP
It's just showing the index page
@Bigeye tuna It's just showing the index page
have you copied the static and public folder?
Bigeye tunaOP
i copied all the files and uploaded to the server. except caching folder (.next)
not only static and public
these are the folders and files that i have
you just need to copy .next/standalone
copy .next/static to .next/standalone/.next/static
copy public to .next/standalone/public
then copy .next/standalone to your server
and node .next/standalone/server.js to start the server
Bigeye tunaOP
i will follow these steps