TypeStrong / fork-ts-checker-webpack-plugin

Webpack plugin that runs typescript type checker on a separate process.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`createRpcWorker` should not override `execArgv`

mook-as opened this issue · comments

Current behavior

I have a project that seems to blow up TypeScript because there are too many generics involved; I have to build it with node --stack-size=… so that the stack is big enough.

Note that it appears that NodeJS does not allow setting this option via NODE_OPTIONS.

However, rpc-worker#createRpcWorker currently clobbers options.execArgv if a memory limit is set, which it always is. This means that I can't pass it in on the command line.

Expected behavior

The relevant line:

options.execArgv = [`--max-old-space-size=${memoryLimit}`];

It would be nice if that's something along the lines of:

    options.execArgv = process.execArgv.concat([`--max-old-space-size=${memoryLimit}`]);

Steps to reproduce the issue

I suppose the easiest would be:

  1. Launch webpack with --stack-size=… arguments.
  2. Check ps output (or equivalent) to see that the TypeScriptReporterRpcService.js processes do not have --stack-size=… in the command line. (They have --max-old-space-size=2048 instead.)

Issue reproduction repository

Sorry, I don't have a minimal test case; hopefully I have provided enough information to be clear what the issue is.

Environment

  • fork-ts-checker-webpack-plugin: 6.5.3
  • typescript: 5.4.5
  • eslint: 8.57.0
  • webpack: 5.91.0
  • os: macOS Ventura 13.6