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

Javascript Heap Error on modules with circular links #66

Open
DanFlor opened this issue Mar 18, 2019 · 3 comments
Open

Javascript Heap Error on modules with circular links #66

DanFlor opened this issue Mar 18, 2019 · 3 comments

Comments

@DanFlor
Copy link

DanFlor commented Mar 18, 2019

The react native schemes manager chokes loops out of control when it encounters circular symlinks within a node module.

Steps to reproduce the behavior

Install a node module with a circular link, such as react-native-http, which contains the obvious circular link:
react-native-http/example/get/node_modules/http-browserify/example/streaming/node_modules/http-browserify -> ../../..

Run react-native-schemes-manager all

Expected behavior

Script completes without error.

Actual behavior

Script meets untimely demise.

Hiding schemes from node_modules xcode projects.
iOS/XXXXXX.xcodeproj
 - [fix-script]: iOS/XXXXXX.xcodeproj skipped

<--- Last few GCs --->

[68345:0x103801e00]   151252 ms: Mark-sweep 1493.3 (1572.4) -> 1493.2 (1541.4) MB, 1981.5 / 0.7 ms  last resort GC in old space requested
[68345:0x103801e00]   153191 ms: Mark-sweep 1493.2 (1541.4) -> 1493.2 (1541.4) MB, 1938.3 / 0.4 ms  last resort GC in old space requested


<--- JS stacktrace --->

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

Security context: 0x13bb3fca58b9 <JSObject>
    1: _readdirEntries [/Users/XXXXXX/Projects/XXXXXX/XXXXXX/XXXXXX/node_modules/glob/glob.js:~559] [pc=0x70da8a28c7e](this=0x13bb3ad956f9 <Glob map = 0x13bbc89233b9>,abs=0x13bbfb9844f1 <String[392]: /Users/XXXXXX/Projects/XXXXXX/XXXXXX/XXXXXX/node_modules/react-native-http/example/get/node_modules/http-browserify/example/streaming/node_modules/http-browse...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

@DanFlor
Copy link
Author

DanFlor commented Mar 18, 2019

This all takes place in an "example" directory; perhaps not follow those? Or possibly have an exclusion list in an environment variable? Dealer's choice. 😃

@rajivshah3
Copy link

Was just about to open an issue for this 😄

We're running into the same issue with the same library (react-native-http). Patching it as shown in #67 fixed the issue

@perlo27
Copy link

perlo27 commented Sep 16, 2019

Or just remove "example" folder from react-native-http

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants