#Memory limit error when running project

1 messages · Page 1 of 1 (latest)

void token
dapper axle
#

hey @void token, what command did you run?

void token
dapper axle
#

can you past the full error please?

void token
#

Ok

dapper axle
#

thanks I need to check which subcommand is failing

void token
#

node:events:495
throw er; // Unhandled 'error' event
^
Error: Worker terminated due to reaching memory limit: JS heap out of memory
at new NodeError (node:internal/errors:405:5)
at [kOnExit] (node:internal/worker:301:26)
at Worker.<computed>.onexit (node:internal/worker:222:20)
Emitted 'error' event on Worker instance at:
at [kOnExit] (node:internal/worker:301:12)
at Worker.<computed>.onexit (node:internal/worker:222:20) {
code: 'ERR_WORKER_OUT_OF_MEMORY'
}

dapper axle
#

there is nothing above that ?

void token
dapper axle
#

please paste all

void token
#

But when the web starts to load it gives that error, then on web I get "This site can't be reached"

void token
dapper axle
#

Thanks, may not be useful but i would like to be sure

void token
dapper axle
#

thanks, looking at it

void token
#

ok,thanks

dapper axle
#

what ram memory does your macbookair have?

void token
dapper axle
#

can you try to run only those 2 commands instead of npx nx start?

npx nx start twenty-server
npx nx start twenty-front
#

in 2 separated terminals

#

@hushed sparrow do you have an idea?

void token
# dapper axle can you try to run only those 2 commands instead of `npx nx start`? ```bash npx ...

oxygen@MacBookAir twenty % npx nx start twenty-front

NX Running target start for project twenty-front and 2 tasks it depends on:

—————————————————————————————————————

nx run twenty-ui:generateBarrels [existing outputs match the cache, left as is]

nx run twenty-ui:build [existing outputs match the cache, left as is]

nx run twenty-front:start

➜ Local: http://localhost:3001/
node:events:495
throw er; // Unhandled 'error' event
^

Error: Worker terminated due to reaching memory limit: JS heap out of memory
at new NodeError (node:internal/errors:405:5)
at [kOnExit] (node:internal/worker:301:26)
at Worker.<computed>.onexit (node:internal/worker:222:20)
Emitted 'error' event on Worker instance at:
at [kOnExit] (node:internal/worker:301:12)
at Worker.<computed>.onexit (node:internal/worker:222:20) {
code: 'ERR_WORKER_OUT_OF_MEMORY'
}

Node.js v18.20.4

—————————————————————————————————————

NX Running target start for project twenty-front and 2 tasks it depends on failed

Failed tasks:

  • twenty-front:start

Hint: run the command with --verbose for more details.

#

npx nx start twenty-server is running

dapper axle
#

ok, so the twenty-front:start command is the issue

void token
#

yes

hushed sparrow
#

@void token how much RAM do you have on your machine? (docker vm or vm if you are using them)

#

The project requires ~5GB to run to get the full dev experience. This is mainly due to two background checks: linter + typescript checker (tsc).

#

If you can, I would recommend to increase your machine RAM (in case of VM)

#

If you can't you can disable these background checks: See: packages/twenty-front/.env.example. Add in your .env VITE_DISABLE_TYPESCRIPT_CHECKER=true and VITE_DISABLE_ESLINT_CHECKER=true

#

this will make running your front way lighter

void token
hushed sparrow
#

ok ! so add the env variables to your .env and you should be fine!

#

your IDE will also check the typescript and lint if properly configured (by default with VSCODE) so you should be fine

void token
#

As per project setup I pasted from .env.example to their respective .env

hushed sparrow
#

VITE_DISABLE_TYPESCRIPT_CHECKER=true and VITE_DISABLE_ESLINT_CHECKER=true

#

in packages/twenty-front/.env

void token
#

Thanks @hushed sparrow and @dapper axle

dapper axle
#

With pleasure, happy it works 🤗

strong scarab
#

I ran the 'npx nx start twenty-front' and 'npx start twenty-server' command to start the project. Here is the error I am getting.

void token
strong scarab
hushed sparrow
#

yes, it will help a lot!

strong scarab
#

Still having issues.

void token
#

@strong scarab Also go to packages/twnety-front/package.json and in that change 3000 with 4096 as it will increase memory size

strong scarab
#

Alright then.

hushed sparrow
#

how much RAM do you have?

strong scarab
#

6gb RAM.

hushed sparrow
#

could you run your front, check how much it takes, then run your server and check how much it takes too?

#

(using top command if you are on linux or Activity Monitor if you are on mac)

strong scarab
hushed sparrow
#

Okay

#

and 6gb is the ram of your linux VM right? not your Windows host

strong scarab
#

6gb is RAM of my windows host not the linux VM.

strong scarab
#

{
"name": "twenty-front",
"version": "0.31.0",
"private": true,
"type": "module",
"scripts": {
"build": "VITE_DISABLE_TYPESCRIPT_CHECKER=true VITE_DISABLE_ESLINT_CHECKER=true NODE_OPTIONS=--max-old-space-size=3000 npx vite build && sh ./scripts/inject-runtime-env.sh",
"build:sourcemaps": "VITE_BUILD_SOURCEMAP=true VITE_DISABLE_TYPESCRIPT_CHECKER=true VITE_DISABLE_ESLINT_CHECKER=true NODE_OPTIONS=--max-old-space-size=6000 npx vite build && sh ./scripts/inject-runtime-env.sh",
"start:prod": "NODE_ENV=production npx vite --host",
"tsup": "npx tsup"
},
"engines": {
"node": "^18.17.1",
"npm": "please-use-yarn",
"yarn": "^4.0.2"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"msw": {
"workerDirectory": "public"
},
"dependencies": {
"@xyflow/react": "^12.0.4",
"transliteration": "^2.3.5"
}
}

void token
strong scarab
strong scarab
hushed sparrow
#

How much do you have on your LInux vm?

strong scarab
strong scarab
#

I still have the same error.

npx nx start twenty-front

NX Running target start for project twenty-front and 2 tasks it depends on:

———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

nx run twenty-ui:generateBarrels [local cache]

nx run twenty-ui:build [local cache]

nx run twenty-front:start

➜ Local: http://localhost:3001/
node:events:492
throw er; // Unhandled 'error' event
^

Error [ERR_WORKER_OUT_OF_MEMORY]: Worker terminated due to reaching memory limit: JS heap out of memory
at new NodeError (node:internal/errors:405:5)
at [kOnExit] (node:internal/worker:287:26)
at Worker.<computed>.onexit (node:internal/worker:209:20)
Emitted 'error' event on Worker instance at:
at [kOnExit] (node:internal/worker:287:12)
at Worker.<computed>.onexit (node:internal/worker:209:20) {
code: 'ERR_WORKER_OUT_OF_MEMORY'
}

Node.js v18.17.1

———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

NX Running target start for project twenty-front and 2 tasks it depends on failed

Failed tasks:

  • twenty-front:start

Hint: run the command with --verbose for more details.

strong scarab
hushed sparrow
#

you seem to only have 3GB on your VM, this is too low to run both FE and BE on Twenty 😦

hushed sparrow
#

If you can allow more resources to your VM it could be a way. Otherwise you can only work on FE and serving the server in production mode (npx nx run twenty-server:build one time, and then yarn server:start:prod)

strong scarab
#

How do I allow more resources to my VM?

strong scarab
#

Hi Charles

strong scarab
#

Should I only run the front-end command to start the project?

hushed sparrow
#

Hi @strong scarab, I'm no WSL expert I'm sorry, you'll likely find the answer on the internet 🙂

#

If you work on FE only you can build your server and serve it in prod mode (will take less memory) and only serve the FE in dev mode

#

so in a terminal:

  • (npx nx run twenty-server:build, then yarn server:start:prod

In another terminal:

  • npx nx run twenty-front:start
#

and make sure to disable the checkers as mentionned above

strong scarab
#

I did all that and I am having a white screen with nothing in it when I go to localhost:/