Cypress e2e JavaScript heap out of memory (transpileOnly)
See original GitHub issueExpected Behavior
While running e2e test I should not receive a JavaScript heap out of memory error
Current Behavior
While running e2e testing on test 23 of 26 I receive the following message.
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Failure Information (for bugs)
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 00007FF62E2507BF uv_open_osfhandle+479
2: 00007FF62CFC9786 node::Abort+22
3: 00007FF62CFC9DA3 node::Abort+1587
4: 00007FF62B5964F8 v8::RetainedObjectInfo::GetElementCount+808
5: 00007FF62B596493 v8::RetainedObjectInfo::GetElementCount+707
6: 00007FF62B60F133 std::_Vector_alloc<std::_Vec_base_types<v8::CpuProfileDeoptInfo,std::allocator<v8::CpuProfileDeoptInfo> > >::_Make_iterator+255075
7: 00007FF62B60E05B std::_Vector_alloc<std::_Vec_base_types<v8::CpuProfileDeoptInfo,std::allocator<v8::CpuProfileDeoptInfo> > >::_Make_iterator+250763
8: 00007FF62B60B6BF std::_Vector_alloc<std::_Vec_base_types<v8::CpuProfileDeoptInfo,std::allocator<v8::CpuProfileDeoptInfo> > >::_Make_iterator+240111
9: 00007FF62B615409 std::_Vector_alloc<std::_Vec_base_types<v8::CpuProfileDeoptInfo,std::allocator<v8::CpuProfileDeoptInfo> > >::_Make_iterator+280377
10: 00007FF62B615A8E std::_Vector_alloc<std::_Vec_base_types<v8::CpuProfileDeoptInfo,std::allocator<v8::CpuProfileDeoptInfo> > >::_Make_iterator+282046
11: 00007FF62B9DF067 std::_Vector_alloc<std::_Vec_base_types<v8::CpuProfileDeoptInfo,std::allocator<v8::CpuProfileDeoptInfo> > >::_Make_iterator+4252567
12: 00007FF62BBC20A9 std::_Vector_alloc<std::_Vec_base_types<v8::CpuProfileDeoptInfo,std::allocator<v8::CpuProfileDeoptInfo> > >::_Make_iterator+6231001
13: 00007FF62BF1AFAF v8::WasmStreaming::Unpack+2677935
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
- Make sure you are on 8.8.2 of @nrwl
- Add many tests (not sure how many, or the determining factor)
- Run e2e tests --headless and get an error 🤞
Context
Please provide any relevant information about your setup:
- version of Nx used
@nrwl/angular : 8.8.2
@nrwl/cli : 8.8.2
@nrwl/cypress : 8.8.2
@nrwl/eslint-plugin-nx : Not Found
@nrwl/express : Not Found
@nrwl/jest : 8.8.2
@nrwl/linter : Not Found
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/react : Not Found
@nrwl/schematics : Not Found
@nrwl/tao : 8.8.2
@nrwl/web : Not Found
@nrwl/workspace : 8.8.2
typescript : 3.5.3
Failure Logs
See above
Other
Researching I found that this issue was reported before and closed in #1871, then possibly reintroduced in PR #1920 https://github.com/nrwl/nx/commit/08f3844007b0224f33b9d78b057a9176b672a0d4#diff-1fdd8c5d37dfa7a97c04b3b7e4c64fafL42 and researching the error I see many solutions pointing towards transpileOnly.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:8
Top Results From Across the Web
cypress-io/cypress - Gitter
Consistently getting a JavaScript heap out of memory error. Running it on a machine with 4gb memory 50gb storage as well as 8gb...
Read more >Fixing Cypress errors part 1: chromium out of memory crashes
Solution 1: Use --ipc=host Docker flag. The was a recommended fix from one of the Cypress authors. This is actually not indicative of...
Read more >Cypress Parallelization — Case Study + Results - Medium
Goal: Decrease time to run e2e tests, speedup CI builds ... CALL_AND_RETRY_LAST Allocation failed — JavaScript heap out of memory” issue.
Read more >Leakage: Memory Leak Testing for Node - Morioh
Does not only support spotting and fixing memory leaks, but writing tests also enables you to ... mocha test/sample.test.js --heap-file heap-diff.json ...
Read more >Cypress E2E Testing - How To Get Primeng Toast Element To ...
As described Cypress e2e JavaScript heap out of memory transpileOnly nrwl/nx#2103. gulp serve That did not work which showed us that we've ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

We are experiencing the same issue when running cypress in CI for our project, and were only able to resolve it by running our e2e tests in chunks, i.e. entirely isolated using a test name pattern. This seems to work fine so far, but comes with limitations (multiple test runs in cypress dashboard, decreased maintainability).
It would be amazing to see a final solution for this in the future.
Thanks for this awesome tool by the way! @FrozenPandaz
Unfortunately, we switched type checking back to being handled
ts-loaderinstead offork-ts-checker-pluginbecause it was causing cypress to hang when using a support file.I believe this unintentional functionality but have not found a fix.
We probably need some assistance from the Cypress team to figure out what is going on here.