Depolying Application with getServerSideProps function
Unanswered
Bigeye tuna posted this in #help-forum
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 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.
I think you could build the standalone output and copy the folder to your server
https://nextjs.org/docs/app/api-reference/next-config-js/output#automatically-copying-traced-files
https://nextjs.org/docs/app/api-reference/next-config-js/output#automatically-copying-traced-files
@Ray I think you could build the standalone output and copy the folder to your server
https://nextjs.org/docs/app/api-reference/next-config-js/output#automatically-copying-traced-files
Bigeye tunaOP
thanks for the response. I will try it
@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 outputcopy the standalone folder to your server
after build
.next/standalone@Ray I think you could build the standalone output and copy the folder to your server
https://nextjs.org/docs/app/api-reference/next-config-js/output#automatically-copying-traced-files
follow the step here to copy the static folder and public folder
Bigeye tunaOP
Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
Error: Error for page /: pages with
Error: Error for page /: pages with
getServerSideProps can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-exportBigeye 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/standalonecopy
copy
.next/static to .next/standalone/.next/staticcopy
public to .next/standalone/publicthen copy
.next/standalone to your serverand
node .next/standalone/server.js to start the serverBigeye tunaOP
i will follow these steps