scalable-react / scalable-react-boilerplate

:star: Scalable feature-first React micro-framework made for Udacity Alumni collaborative projects
https://scalable-react-boilerplate.herokuapp.com/
MIT License
259 stars 60 forks source link

eslint fails with FatalProcessOutOfMemory #80

Closed monte-hayward closed 7 years ago

monte-hayward commented 7 years ago

With node_modules installed, npm run lint runs out of memory. Similar to this report: https://github.com/nodejs/node/issues/8162

 git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
$ scalable-react-boilerplate 09:54:46
 npm run lint

> scalable-react-boilerplate@1.1.0 lint /path/scalable-react-boilerplate
> eslint . --ext .js --ext .jsx; exit 0

<--- Last few GCs --->

  227800 ms: Mark-sweep 1267.3 (1415.4) -> 1258.7 (1417.4) MB, 1402.6 / 0 ms [allocation failure] [GC in old space requested].
  229293 ms: Mark-sweep 1258.7 (1417.4) -> 1256.1 (1418.4) MB, 1493.3 / 0 ms [allocation failure] [GC in old space requested].
  230840 ms: Mark-sweep 1256.1 (1418.4) -> 1255.1 (1404.4) MB, 1546.1 / 0 ms [last resort gc].
  232300 ms: Mark-sweep 1255.1 (1404.4) -> 1255.0 (1398.4) MB, 1460.2 / 0 ms [last resort gc].

<--- JS stacktrace --->

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

Security context: 0x8e60afc9e59 <JS Object>
    1: Join(aka Join) [native array.js:179] [pc=0x1c3f092d0615] (this=0x8e60af04189 <undefined>,w=0x1248990447f9 <JS Array[227643]>,x=227643,N=0x208a90bf8729 <String[1]\: \n>,M=0x8e60afb49b1 <JS Function ConvertToString (SharedFunctionInfo 0x8e60af4ef79)>)
    2: InnerArrayJoin(aka InnerArrayJoin) [native array.js:~343] [pc=0x1c3f09488b6c] (this=0x8e60af04189 <undefined>,N=0x208a90bf8729 <String...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/usr/local/bin/node]
 2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [/usr/local/bin/node]
 3: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/usr/local/bin/node]
 4: v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [/usr/local/bin/node]
 5: v8::internal::Runtime_StringBuilderJoin(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/bin/node]
 6: 0x1c3f0660961b
sh: line 1: 67136 Abort trap: 6           eslint . --ext .js --ext .jsx
$ scalable-react-boilerplate 10:01:08

With npm modules removed, import declarations are reported illegal.

 rm -rf node_modules/
$ scalable-react-boilerplate 10:13:44
 npm run lint

> scalable-react-boilerplate@1.1.0 lint /path/to/scalable-react-boilerplate
> eslint . --ext .js --ext .jsx; exit 0

/path/to/scalable-react-boilerplate/app/src/apolloClient.js
  1:2  error  Parsing error: Illegal import declaration

/path/to/scalable-react-boilerplate/app/src/components/About/index.js
  2:2  error  Parsing error: Illegal import declaration

... [ and so on ]
RyanCCollins commented 7 years ago

Hey @monte-hayward, yes I see this too. That's curious. I am not sure what the issue is? I will have to tinker with it for a bit.

RyanCCollins commented 7 years ago

This has been resolved! It turns out that the server/ dir was not ignored and it was failing to lint the gigantic bundle 😨 . Thank you very much for reporting it 😄