Deploying Next 13 with App Router on a Web Host (CPanel)
Unanswered
Citrus blackfly parasitoid posted this in #help-forum
Citrus blackfly parasitoidOP
Hi, I'm desperately trying to deploy Next 13 with the App Router on a web host (not Vercel). I need the SSR, so I can't export or use the standalone folder. I've tried with my project, as well as a freshly created one, but both return the same error.
I'm using this doc to deploy the project: https://nextjs.org/docs/pages/building-your-application/configuring/custom-server
I created a new Next 13 project for testing, without typescript, without the src folder, and with the new App router.
- I created the
- Edited
- Build project locally
- Moved all project files to FTP, with the exception of
- Created the Node.js environment on version 18.16.0 via CPanel, specifying the server.js file as the startup file.
- Npm install and run the server
Once on the domain name, I get the page below.
As well as these server side errors (apps/portfolio is the directory where the files are located) :
I also tried without node environment and with the
If anyone has a solution, I'm interested.
I'm using this doc to deploy the project: https://nextjs.org/docs/pages/building-your-application/configuring/custom-server
I created a new Next 13 project for testing, without typescript, without the src folder, and with the new App router.
- I created the
server.js file (code available on the doc above)- Edited
npm start"start": "cross-env NODE_ENV=production node server.js",- Build project locally
- Moved all project files to FTP, with the exception of
.git nodes_modules .gitignore and README.- Created the Node.js environment on version 18.16.0 via CPanel, specifying the server.js file as the startup file.
- Npm install and run the server
Once on the domain name, I get the page below.
As well as these server side errors (apps/portfolio is the directory where the files are located) :
App 262270 output: at 2564 (/home/user/apps/portfolio/.next/server/chunks/120.js:1:79653) {
App 262270 output: at __webpack_require__ (/home/user/apps/portfolio/.next/server/webpack-runtime.js:1:145)
App 262270 output: at 5319 (/home/meti3679/apps/portfolio/.next/server/app/_not-found.js:1:547)
App 262270 output: at mod.require (/home/user/nodevenv/apps/portfolio/18/lib/node_modules/next/dist/server/require-hook.js:64:28)
App 262270 output: at /home/user/nodevenv/apps/portfolio/18/lib/node_modules/next/dist/server/require-hook.js:54:36I also tried without node environment and with the
next start script while exposing the files directly in a folder but nothing happens other than confirming that the server is started on http://localhost:3000/If anyone has a solution, I'm interested.
4 Replies
can i ask why you can't just use
next start to start (and after next build)?@riský can i ask why you can't just use `next start` to start (and after `next build`)?
Citrus blackfly parasitoidOP
I get this error when doing a build from the server so I copied the .next locally directly onto the server, it doesn't work?
uncaughtException Error: spawn /opt/alt/alt-nodejs18/root/usr/bin/node EAGAIN
at ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -11,
code: 'EAGAIN',
syscall: 'spawn /opt/alt/alt-nodejs18/root/usr/bin/node',
path: '/opt/alt/alt-nodejs18/root/usr/bin/node',
spawnargs: [
'/home/user/public_html/node_modules/next/dist/compiled/jest-worker/processChild.js'
]
}uhhh thats odd
@riský uhhh thats odd
Citrus blackfly parasitoidOP
yes ðŸ˜