Replies: 11 comments 11 replies
-
I am also facing same issue, my app also works fine in local but, after hosting in cpanel with all steps followed, the app goes blank. |
Beta Was this translation helpful? Give feedback.
-
Same here, we had a website hosted on cpanel for almost a year already, it crashed when I updated my packages to match nextjs13 |
Beta Was this translation helpful? Give feedback.
-
Same thing. I tested some versions, 13.4.13 is the last one that works for me. With later versions I just get empty responses (even with the example project). |
Beta Was this translation helpful? Give feedback.
-
Same issue here but on a Plesk server. I've also made changes to the I'm using Next 13.4.19 and Node 16.20. |
Beta Was this translation helpful? Give feedback.
-
Bumping this, as the issue still persists with Next.JS 14 and 15-RC.0. |
Beta Was this translation helpful? Give feedback.
-
The process worked to end to end, but when I open the URL, I get the notification "It works! NodeJS 20.18.3", Would you know why? |
Beta Was this translation helpful? Give feedback.
-
Next.js needs node v18.17.. min. I believe to work on a server. |
Beta Was this translation helpful? Give feedback.
-
I am having the same issue.
Fix /a and /b, they should be pages related to your app. So for example if you have a cart page and say a blog page that take url queries, Not sure if this will fix your problem though. |
Beta Was this translation helpful? Give feedback.
-
Hi team, I’m following up on the issue regarding deploying a simple Next.js application on cPanel. Despite allocating 4GB of RAM, I’m unable to get even a basic test project running. I created the required server.js file as per documentation: import express from "express"; const port = process.env.PORT || 3000; app.prepare().then(() => {
}); My package.json contains the following script: "scripts": { Node.js version: 20.17.0 However, when running the start script through the UI using "RUN JS SCRIPT", I get this error: RangeError: WebAssembly.instantiate(): Out of memory: Cannot allocate Wasm memory for new instance The Node.js process fails with a WebAssembly memory allocation error, although the application only consumes ~24MB of RAM when tested on a Debian VM with 4GB RAM (same conditions, runs fine). Limits shown include: Max resident set: 4GB Max address space: 4GB I’ve already reviewed that the issue is not on the application side. Could you please: Confirm if this may be due to LVE limits or a deeper issue with the platform's WebAssembly/node runtime? Attempt to deploy a test Next.js app yourselves on this environment for validation (perhaps using the example starter project)? Let me know if any tuning is needed for this kind of app. Thanks in advance for the support. Let me know if you need access logs or configs. Best regards, |
Beta Was this translation helpful? Give feedback.
-
I was told by my hosting tech staff that the memory error is because of the Node setup UI and memory limits can not be increased for this in CPanel. They advised me to use terminal for this instead. Also. I found this regarding your code you posted.
|
Beta Was this translation helpful? Give feedback.
-
I have had some success with loading my app. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I deployed my Next.js app on cPanel and its blank. It works fine locally. Here are the steps I followed :
1.First, I created a custom server.js in my root directory with the following code :
`const { createServer } = require('http')
const { parse } = require('url')
const next = require('next')
const dev = process.env.NODE_ENV !== 'production'
const hostname = 'localhost'
const port = 3000
// when using middleware
hostname
andport
must be provided belowconst app = next({ dev, hostname, port })
const handle = app.getRequestHandler()
app.prepare().then(() => {
createServer(async (req, res) => {
try {
// Be sure to pass
true
as the second argument tourl.parse
.// This tells it to parse the query portion of the URL.
const parsedUrl = parse(req.url, true)
const { pathname, query } = parsedUrl
})
.once('error', (err) => {
console.error(err)
process.exit(1)
})
.listen(port, () => {
console.log(
> Ready on http://${hostname}:${port}
)})
})
`
"scripts": { "dev": "next dev", "build": "next build", "start": "NODE_ENV=production node server.js", "lint": "next lint" },
After all these steps, my app is blank, and I don't know what I did wrong.
Here is a Github link where you can see all the app code. I'm stuck since yesterday and I appreciate any help you can give me to resolve this problem. I know the issue is due to my app but I can't figure it out. But I'm pretty sure the main problem is located on the server.js file.
I hope all the information I provided could help you to understand.
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions