Skip to content
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.

ForkTsCheckerWebpackPlugin out of memory #369

Open
stephenkoo opened this issue Jul 19, 2018 · 6 comments
Open

ForkTsCheckerWebpackPlugin out of memory #369

stephenkoo opened this issue Jul 19, 2018 · 6 comments

Comments

@stephenkoo
Copy link

Is this a bug report?

Yes.

Can you also reproduce the problem with npm 4.x?

Yes.

Which terms did you search for in User Guide?

ForkTsCheckerWebpackPlugin, out of memory, fork-ts-checker-webpack-plugin, memoryLimit.

Environment

  1. Operating system: macOS High Sierra v1013.6
  2. Browser and version:
  • Node 10.7.0
  • npm 4 as instructed (but use yarn v1.7.0 usually),

Steps to Reproduce

  1. Open project
  2. npm install
  3. npm start

Expected Behavior

To run the app, displaying a <button> element with the text Yo.

Actual Behavior

Produces error:

ts-loader: Using [email protected] and /Users/stephenkoo/code/src/gitlab.com/stephenkoo/kanso/tsconfig.json

<--- Last few GCs --->

[4141:0x104002400]    36973 ms: Scavenge 2033.4 (2079.8) -> 2033.1 (2080.3) MB, 2.9 / 0.0 ms  (average mu = 0.112, current mu = 0.046) allocation failure
[4141:0x104002400]    36978 ms: Scavenge 2033.8 (2080.3) -> 2033.4 (2081.3) MB, 2.8 / 0.0 ms  (average mu = 0.112, current mu = 0.046) allocation failure
[4141:0x104002400]    36985 ms: Scavenge 2034.1 (2081.3) -> 2033.7 (2081.8) MB, 3.4 / 0.0 ms  (average mu = 0.112, current mu = 0.046) allocation failure


<--- JS stacktrace --->

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

    0: ExitFrame [pc: 0x134e18a841bd]
    1: StubFrame [pc: 0x134e18aa470f]
Security context: 0x1428929e6c9 <JSObject>
    2: slice [0x14289286979](this=0x142733482b9 <JSArray[6]>,0)
    3: /* anonymous */(aka /* anonymous */) [0x14273348371] [/Users/stephenkoo/code/src/gitlab.com/stephenkoo/kanso/node_modules/typescript/lib/typescript.js:~34457] [pc=0x134e18fdf769](this=0x142995822e1 <undefined>,t=0x1426fe04419 <TypeObject map = 0x14259d...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x100037ddb node::Abort() [/usr/local/Cellar/node/10.7.0/bin/node]
 2: 0x100037f65 node::OnFatalError(char const*, char const*) [/usr/local/Cellar/node/10.7.0/bin/node]
 3: 0x10018274b v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/Cellar/node/10.7.0/bin/node]
 4: 0x1001826ed v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/Cellar/node/10.7.0/bin/node]
 5: 0x10045b3fe v8::internal::Heap::UpdateSurvivalStatistics(int) [/usr/local/Cellar/node/10.7.0/bin/node]
 6: 0x10045d0a1 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [/usr/local/Cellar/node/10.7.0/bin/node]
 7: 0x10045a763 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/local/Cellar/node/10.7.0/bin/node]
 8: 0x1004596b4 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/Cellar/node/10.7.0/bin/node]
 9: 0x1004618b3 v8::internal::Heap::AllocateRawWithRetry(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/local/Cellar/node/10.7.0/bin/node]
10: 0x10043f4bc v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [/usr/local/Cellar/node/10.7.0/bin/node]
11: 0x100639d91 v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/Cellar/node/10.7.0/bin/node]
12: 0x134e18a841bd
Type checking and linting aborted - probably out of memory. Check `memoryLimit` option in ForkTsCheckerWebpackPlugin configuration.

screen shot 2018-07-19 at 7 23 47 pm

screen shot 2018-07-19 at 7 23 57 pm

Reproducible Demo

https://github.com/wmonk/create-react-app-typescript/files/2209236/kanso.zip

@malafreniere
Copy link

Getting the same error, would be nice to be able to override the memoryLimit option of ForkTsCheckerWebpackPlugin in https://github.com/wmonk/create-react-app-typescript/blob/master/packages/react-scripts/config/webpack.config.dev.js

new ForkTsCheckerWebpackPlugin({
      async: false,
      watch: paths.appSrc,
      tsconfig: paths.appTsConfig,
      tslint: paths.appTsLint,
      --> memoryLimit: env.tsCheckerMemoryLimit <-- ???
    }),

@adamhp
Copy link

adamhp commented Jul 31, 2018

I'm receiving this error also, apparently after upgrading my node version to 10.7.0, from what I can tell, but may be unrelated.

@DorianGrey
Copy link
Collaborator

Given the instructions above, you were using node 10.x. Is this error reproducible with 8.11 (the current LTS) as well?

@sbusch
Copy link

sbusch commented Aug 6, 2018

node 8.11.3, same error

@leobrdar
Copy link

leobrdar commented Oct 2, 2018

Hi all,

any updates on this? Did any of you find a workaround?

I'm getting a similar issue:

Starting the development server...

ts-loader: Using [email protected] and /Users/leo/my-app/tsconfig.json
/Users/leo/my-app/node_modules/fork-ts-checker-webpack-plugin/lib/service.js:22
        throw error;
        ^

RangeError: Maximum call stack size exceeded
    at Object.flatMap (/Users/leo/my-app/node_modules/tslint/lib/utils.js:151:18)
    at Linter.getAllFailures (/Users/leo/my-app/node_modules/tslint/lib/linter.js:139:32)
    at Linter.lint (/Users/leo/my-app/node_modules/tslint/lib/linter.js:99:33)
    at /Users/leo/my-app/node_modules/fork-ts-checker-webpack-plugin/lib/IncrementalChecker.js:142:30
    at WorkSet.forEach (/Users/leo/my-app/node_modules/fork-ts-checker-webpack-plugin/lib/WorkSet.js:17:13)
    at IncrementalChecker.getLints (/Users/leo/my-app/node_modules/fork-ts-checker-webpack-plugin/lib/IncrementalChecker.js:139:17)
    at run (/Users/leo/my-app/node_modules/fork-ts-checker-webpack-plugin/lib/service.js:15:29)
    at process.<anonymous> (/Users/leo/my-app/node_modules/fork-ts-checker-webpack-plugin/lib/service.js:38:5)
    at emitTwo (events.js:126:13)
    at process.emit (events.js:214:7)

Could this be the same issue or is this something different?

Environment:

  • macOS High Sierra 10.13.6
  • yarn 1.9.4.
  • node 8.11.2
  • react-scripts-ts 2.17.0 (which uses fork-ts-checker-webpack-plugin ^0.2.8)

@kelly-tock
Copy link

is setting memoryLimit option not working for you?

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

No branches or pull requests

7 participants