Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress: JavaScript heap out of memory error #1871

Closed
skydever opened this issue Sep 23, 2019 · 1 comment
Closed

Cypress: JavaScript heap out of memory error #1871

skydever opened this issue Sep 23, 2019 · 1 comment
Labels

Comments

@skydever
Copy link
Contributor

Expected Behavior

Cypress tests should not fail with an JavaScript heap out of memory error.

Current Behavior

After upgrading to the latest version of the @nrwl/cypress:cypress builder, 8.5.0, my cypress tests start to fail with an JavaScript heap out of memory error.

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/builds/bgenbmdoe/HMI/cache/Cypress/3.4.1/Cypress/libnode.so]
 2: 0x7f1e5f3ad8d7 [/builds/bgenbmdoe/HMI/cache/Cypress/3.4.1/Cypress/libnode.so]
 3: 0x7f1e5f31fe67 [/builds/bgenbmdoe/HMI/cache/Cypress/3.4.1/Cypress/libnode.so]
 4: 0x7f1e5f31fde5 [/builds/bgenbmdoe/HMI/cache/Cypress/3.4.1/Cypress/libnode.so]
 5: v8::internal::Factory::NewFixedArray(int, v8::internal::PretenureFlag) [/builds/bgenbmdoe/HMI/cache/Cypress/3.4.1/Cypress/libnode.so]
 6: 0x7f1e5f2a47a3 [/builds/bgenbmdoe/HMI/cache/Cypress/3.4.1/Cypress/libnode.so]
 7: 0x7f1e5f2a5e12 [/builds/bgenbmdoe/HMI/cache/Cypress/3.4.1/Cypress/libnode.so]
 8: 0x7f1e5f2a5401 [/builds/bgenbmdoe/HMI/cache/Cypress/3.4.1/Cypress/libnode.so]
 9: 0x7f1e5f2a3737 [/builds/bgenbmdoe/HMI/cache/Cypress/3.4.1/Cypress/libnode.so]
10: 0x7f1e5f2a333d [/builds/bgenbmdoe/HMI/cache/Cypress/3.4.1/Cypress/libnode.so]
11: 
<--- Last few GCs --->

[448:0x303d43fe9000]   930244 ms: Mark-sweep 2060.6 (2152.1) -> 2060.7 (2131.6) MB, 2188.2 / 0.0 ms  (+ 0.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 2188 ms) last resort GC in old space requested
[448:0x303d43fe9000]   932626 ms: Mark-sweep 2060.7 (2131.6) -> 2060.5 (2131.1) MB, 2380.6 / 0.0 ms  last resort GC in old space requested


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x2ed9f712b0a1 <JSObject>
    1: removeTrailingWhitespace(aka removeTrailingWhitespace) [/builds/bgenbmdoe/HMI/app/client/hmi-client-workspace/node_modules/typescript/lib/typescript.js:~22435] [pc=0xc238e679ae2](this=0x3ae6e5282311 <undefined>,comments=0x28ad48ab5961 <JSArray[12]>)
    2: /* anonymous */(aka /* anonymous */) [/builds/bgenbmdoe/HMI/app/client/hmi-client-workspace/node_modules/typescript/lib/typescript.js:...

0x7f1e5f2aa381 [/builds/bgenbmdoe/HMI/cache/Cypress/3.4.1/Cypress/libnode.so]
12: 0xc238e50463d

All following tests get the following error:

The following error was thrown by a plugin. We've stopped running your tests because a plugin crashed.

Error [ERR_IPC_CHANNEL_CLOSED]: channel closed
    at ChildProcess.target.send (internal/child_process.js:588:16)
    at Object.send (/builds/bgenbmdoe/HMI/cache/Cypress/3.4.1/Cypress/resources/app/packages/server/lib/plugins/util.js:34:27)
    at EventEmitter.<anonymous> (/builds/bgenbmdoe/HMI/cache/Cypress/3.4.1/Cypress/resources/app/packages/server/lib/plugins/preprocessor.js:60:18)
    at emitOne (events.js:121:20)
    at EventEmitter.emit (events.js:211:7)
    at Object.removeFile (/builds/bgenbmdoe/HMI/cache/Cypress/3.4.1/Cypress/resources/app/packages/server/lib/plugins/preprocessor.js:108:19)
    at Object.options.onBrowserClose (/builds/bgenbmdoe/HMI/cache/Cypress/3.4.1/Cypress/resources/app/packages/server/lib/open_project.js:100:30)
    at EventEmitter.<anonymous> (/builds/bgenbmdoe/HMI/cache/Cypress/3.4.1/Cypress/resources/app/packages/server/lib/browsers/index.js:131:21)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:111:20)
    at EventEmitter.emit (events.js:208:7)
    at BrowserWindow.<anonymous> (/builds/bgenbmdoe/HMI/cache/Cypress/3.4.1/Cypress/resources/app/packages/server/lib/browsers/electron.js:248:29)
    at Object.onceWrapper (events.js:315:30)
    at emitOne (events.js:121:20)
    at BrowserWindow.emit (events.js:211:7)

Failure Information (for bugs)

The cypress builder is using ts-loader (the version of the builder I used previously did not use ts-loader, I was using the legacy version) and it seems that there is an memory issue. See this cypress issue.

Other

I will create a pr containing the solution that I use for my projects based on this comment.

skydever added a commit to skydever/nx that referenced this issue Sep 23, 2019
... and use the ForkTsCheckerWebpackPlugin
for the cypress test execution.

Closes nrwl#1871
skydever added a commit to skydever/nx that referenced this issue Sep 23, 2019
... and use the ForkTsCheckerWebpackPlugin
for the cypress test execution.

Closes nrwl#1871
Doginal pushed a commit to Doginal/nx that referenced this issue Oct 30, 2019
... and use the ForkTsCheckerWebpackPlugin
for the cypress test execution.

Closes nrwl#1871
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant