Skip to main content
cPanel Technical Support has been heavily impacted by hurricane Beryl and our ability to respond to tickets has been hindered as a result. We appreciate your understanding and patience as we address these delays.

Error Building React App Using Built-In Terminal

Comments

11 comments

  • cPRex Jurassic Moderator
    Hey there! Unfortunately, there likely isn't much you can do on your end for this issue. The most likely explanation is that you are hitting an internal memory limit for cPanel itself, which could only be confirmed and adjusted by the host. They would be able to check the /usr/local/cpanel/logs/error_log file to confirm that this is the case, and then use the various options in WHM >> Tweak Settings to adjust that limit.
    0
  • cPanelThomas
    I am somewhat curious if running the command in a manner which disowns it from the terminal would resolve this issue. Does running the command via nohup
    change things, or not? Ex. nohup &
    . If not, perhaps & disown
    0
  • testingIntegration
    I am somewhat curious if running the command in a manner which disowns it from the terminal would resolve this issue. Does running the command via nohup
    change things, or not? Ex. nohup &
    . If not, perhaps & disown

    Thank you for the response. Unfortunately, both commands responded with the same error message. I also tried running them in the shell script and the results were the same.
    The most likely explanation is that you are hitting an internal memory limit for cPanel itself, which could only be confirmed and adjusted by the host.

    Seems like you're right. A L2 tech from my provider got back to me late last night and they let me know that the terminal in CPanel isn't designed for resource-intensive tasks and they already maximized the per cPanel process memory allocation to the highest possible level. Had no idea CPanel's terminal worked differently. Bummer. But thanks for the input.
    0
  • cPRex Jurassic Moderator
    I'm glad they were able to confirm the cause for you, at least!
    0
  • BAHANI BILLEL

    ima having the same error , i am trying to deploy a nextjs application  using cpanel , but iam stil getting this error "webassembly.instantiate(): out of memory: wasm memory cpanel"

    please  i need a help

    0
  • cPRex Jurassic Moderator

    BAHANI BILLEL - it would likely be best to create a new thread with specific details about your situation so we can help.

    0
  • BAHANI BILLEL

    Iam trying to deploy a next.js application , i have uploaded website file to cpanel including the custom server as follows 

    const { createServer } = require("http");
    const { parse } = require("url");
    const next = require("next");

    const dev = process.env.NODE_ENV !== "production";
    const hostname = "localhost";
    const port = process.env.PORT || 3000;
    // when using middleware `hostname` and `port` must be provided below
    const 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 to `url.parse`.
          // This tells it to parse the query portion of the URL.
          const parsedUrl = parse(req.url, true);
          const { pathname, query } = parsedUrl;

          if (pathname === "/a") {
            await app.render(req, res, "/a", query);
          } else if (pathname === "/b") {
            await app.render(req, res, "/b", query);
          } else {
            await handle(req, res, parsedUrl);
          }
        } catch (err) {
          console.error("Error occurred handling", req.url, err);
          res.statusCode = 500;
          res.end("internal server error");
        }
      })
        .once("error", (err) => {
          console.error(err);
          process.exit(1);
        })
        .listen(port, () => {
          console.log(`> Ready on http://${hostname}:${port}`);
        });
    });
    and also updated the scripts as follows 
     "scripts": {
        "dev": "next dev",
        "build": "next build",
        "start": "NODE_ENV=production node server.js",
        "lint": "next lint",
        "test": "jest --coverage"
      },
     
    then i created a node application and installed the npm package normally, 

    but whenever i run the scripts i get the following error 

    returncode: 1 stdout: > simyah@0.1.0 start > next start ▲ Next.js 14.0.4 - Local: http://localhost:3000 stderr: RangeError: WebAssembly.instantiate(): Out of memory: Cannot allocate Wasm memory for new instance at lazyllhttp (node:internal/deps/undici/undici:7806:32) RangeError: WebAssembly.instantiate(): Out of memory: Cannot allocate Wasm memory for new instance at lazyllhttp (eval at requireWithFakeGlobalScope (/home/anvusemv/nodevenv/simyah/20/lib/node_modules/next/dist/compiled/@edge-runtime/primitives/load.js:65:3), <anonymous>:9988:32) [Error: ENOENT: no such file or directory, open '/home/anvusemv/simyah/.next/BUILD_ID'] { errno: -2, code: 'ENOENT', syscall: 'open', path: '/home/anvusemv/simyah/.next/BUILD_ID' } 
     
    Please help.
     
     
    0
  • cPRex Jurassic Moderator

    Are you able to increase the memory use on the account?

    0
  • BAHANI BILLEL

    unfortinatly i don't since iam on shared hosting plan, i tried to run  node --max-old-space-size=4096 , but i didn't work ,

    0
  • cPRex Jurassic Moderator

    You'll likely need to contact the host since you're on a shared plan.

    0
  • BAHANI BILLEL

    thank you for the feedback , i will be contacting the host but i may contact you later

    1

Please sign in to leave a comment.