51 Replies
hey @shyamsundertard, what command did you run?
npx nx start
can you past the full error please?
Ok
thanks I need to check which subcommand is failing
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'
}
there is nothing above that ?
Above code have no error, that code comes after running "npx nx start", and giving no errors
please paste all
But when the web starts to load it gives that error, then on web I get "This site can't be reached"
Ok
Thanks, may not be useful but i would like to be sure
thanks, looking at it
ok,thanks
what ram memory does your macbookair have?
8GB
can you try to run only those 2 commands instead of
npx nx start
?
in 2 separated terminals
@charles do you have an idea?ok
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
ok, so the twenty-front:start command is the issue
yes
@shyamsundertard 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
I am not using docker or any any vm, just using postgres in my device itself, it has 8/256 RAM/ROM
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
which env variables?
As per project setup I pasted from .env.example to their respective .env
VITE_DISABLE_TYPESCRIPT_CHECKER=true and VITE_DISABLE_ESLINT_CHECKER=true
in packages/twenty-front/.env
Thanks, now working without error.
Thanks @charles and @martmull
With pleasure, happy it works 🤗
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.
Have to made above discussed changes ?
I need help to make it work.
yes, it will help a lot!
Yes I have.
I did this VITE_DISABLE_TYPESCRIPT_CHECKER=true and VITE_DISABLE_ESLINT_CHECKER=true
in packages/twenty-front/.env
Still having issues.
@oyiks Also go to packages/twnety-front/package.json and in that change 3000 with 4096 as it will increase memory size
Alright then.
how much RAM do you have?
6gb RAM.
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)
Alright then. I am using WSL on windows.
Okay
and 6gb is the ram of your linux VM right? not your Windows host
6gb is RAM of my windows host not the linux VM.
This is what I find.
{
"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"
}
}
In build replace 3000 by 4096
Done.
I can run npx nx start now right?
How much do you have on your LInux vm?
I don't know, how do I check that?
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. This is what I got total used free shared buff/cache available Mem: 2.6Gi 743Mi 1.8Gi 12Mi 288Mi 1.9Gi Swap: 1.0Gi 157Mi 866Mi
you seem to only have 3GB on your VM, this is too low to run both FE and BE on Twenty 😦
What can I do then?
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)
How do I allow more resources to my VM?
Hi Charles
Should I only run the front-end command to start the project?
Hi @oyiks, 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
Thanks.
I did all that and I am having a white screen with nothing in it when I go to localhost:/
*localhost:3001/