fork-ts-checker-webpack-plugin: RpcIpcMessagePortClosedError: Process 9160 exited with code "1"

Current behavior

I’m getting this error after upgrade to the latest version (6.4.0):

No issues found.
{absolutePathRemoved}\node_modules\typescript\lib\typescript.js:2559
            throw e;
            ^

Error: Debug Failure.
    at {absolutePathRemoved}\node_modules\typescript\lib\typescript.js:19596:89
    at String.replace (<anonymous>)
    at formatStringFromArgs ({absolutePathRemoved}\node_modules\typescript\lib\typescript.js:19596:21)
    at Object.createCompilerDiagnostic ({absolutePathRemoved}\node_modules\typescript\lib\typescript.js:19701:20)
    at tryReadFile ({absolutePathRemoved}\node_modules\typescript\lib\typescript.js:39904:23)
    at Object.getParsedCommandLineOfConfigFile ({absolutePathRemoved}\node_modules\typescript\lib\typescript.js:39852:30)
    at parseConfigFile ({absolutePathRemoved}\node_modules\typescript\lib\typescript.js:120744:43)
    at reloadConfigFile ({absolutePathRemoved}\node_modules\typescript\lib\typescript.js:120735:13)
    at updateProgram ({absolutePathRemoved}\node_modules\typescript\lib\typescript.js:120710:21)
    at updateProgramWithWatchStatus ({absolutePathRemoved}\node_modules\typescript\lib\typescript.js:120700:13)
{absolutePathRemoved}\node_modules\fork-ts-checker-webpack-plugin\lib\rpc\rpc-ipc\RpcIpcMessagePort.js:19
        closedError = new RpcIpcMessagePortClosedError_1.RpcIpcMessagePortClosedError(code
                      ^

RpcIpcMessagePortClosedError: Process 9160 exited with code "1" [null]
    at {absolutePathRemoved}\node_modules\fork-ts-checker-webpack-plugin\lib\rpc\rpc-ipc\RpcIpcMessagePort.js:19:23
    at Generator.next (<anonymous>)
    at {absolutePathRemoved}\node_modules\fork-ts-checker-webpack-plugin\lib\rpc\rpc-ipc\RpcIpcMessagePort.js:8:71
    at new Promise (<anonymous>)
    at __awaiter ({absolutePathRemoved}\node_modules\fork-ts-checker-webpack-plugin\lib\rpc\rpc-ipc\RpcIpcMessagePort.js:4:12)
    at ChildProcess.handleExit ({absolutePathRemoved}\node_modules\fork-ts-checker-webpack-plugin\lib\rpc\rpc-ipc\RpcIpcMessagePort.js:18:42)
    at ChildProcess.emit (node:events:394:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12) {
  code: 1,
  signal: null
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Build finishes fine, seems that even the checking as per the “No issues found” line, but then I get this error and the dev server process crashes. Any ideas what can be wrong?

Expected behavior

The previous version 6.3.4 was running fine with no issues (on the same codebase). I have even verified by reverting the yarn upgrade changes in git and running the same command. Works just fine, it must be some change between the 6.3.4 and 6.4.0.

Steps to reproduce the issue

Just running yarn start what runs webpack serve --config webpack.config.development.js

Issue reproduction repository

Environment

devDependencies (all I thought they might be possibly related)
@typescript-eslint/parser”: “^5.4.0”, “eslint”: “^8.2.0”, “eslint-import-resolver-webpack”: “^0.13.2”, “eslint-plugin-flowtype”: “^8.0.3”, “eslint-plugin-import”: “^2.25.3”, “eslint-plugin-jsx-a11y”: “^6.5.1”, “eslint-plugin-react”: “^7.27.0”, “fork-ts-checker-webpack-plugin”: “^6.4.0”, “ts-loader”: “^9.2.6”, “typescript”: “^4.5.2”, “webpack”: “^5.64.1”, “webpack-cli”: “^4.9.1”, “webpack-dev-server”: “^4.5.0”

  • os: Windows 10
  • Yarn: 1.22.5

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 4
  • Comments: 43

Commits related to this issue

Most upvoted comments

🎉 This issue has been resolved in version 7.2.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

🎉 This issue has been resolved in version 6.5.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

I created a PR 😃 I didn’t test backporting feature of semantic release before, so let’s hope this will work 😄

🎉 This issue has been resolved in version 7.2.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

Thanks for the detailed response. I will create an e2e test with a project that triggers package.json change. It will run in our CI on a Windows machine. I hope I will be able to reproduce the bug this way. Regarding logging, I didn’t have time to debug this but my bet is that vue cli is not passing these options correctly to the webpack 🤔 But that’s just a guess. These settings works in our e2e tests so I think they are correct. Here is a test fixture where we use it: https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/blob/main/test/e2e/fixtures/typescript-basic/webpack.config.js

🎉 This issue has been resolved in version 7.2.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@piotr-oles I am using create-react-app, and I just tried this patch out locally by modifying it in node_modules and it seems to work. Thank you!

Given they are currently on v6.5.0, would it be possible to get a patch for v6.5.0 as well to ease the transition until create-react-app migrates to the latest version of fork-ts-checker-webpack-plugin?

Having the same issue as @vocko.

Tried to:

Nothing helped.

Still receiving the same issue (copy from my terminal):

Compiling...
<project_dir>/node_modules/typescript/lib/typescript.js:2559
            throw e;
            ^

Error: Debug Failure.
    at <project_dir>/node_modules/typescript/lib/typescript.js:19608:89
    at String.replace (<anonymous>)
    at formatStringFromArgs (<project_dir>/node_modules/typescript/lib/typescript.js:19608:21)
    at Object.createCompilerDiagnostic (<project_dir>/node_modules/typescript/lib/typescript.js:19713:20)
    at tryReadFile (<project_dir>/node_modules/typescript/lib/typescript.js:39916:23)
    at Object.getParsedCommandLineOfConfigFile (<project_dir>/node_modules/typescript/lib/typescript.js:39864:30)
    at parseConfigFile (<project_dir>/node_modules/typescript/lib/typescript.js:120775:43)
    at reloadConfigFile (<project_dir>/node_modules/typescript/lib/typescript.js:120766:13)
    at updateProgram (<project_dir>/node_modules/typescript/lib/typescript.js:120741:21)
    at updateProgramWithWatchStatus (<project_dir>/node_modules/typescript/lib/typescript.js:120731:13)
<project_dir>/node_modules/react-scripts/scripts/start.js:19
  throw err;
  ^

RpcIpcMessagePortClosedError: Process 7770 exited with code "1" [null]
    at <project_dir>/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:19:23
    at Generator.next (<anonymous>)
    at <project_dir>/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (<project_dir>/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:4:12)
    at ChildProcess.handleExit (<project_dir>/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:18:42)
    at ChildProcess.emit (events.js:375:28)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) {
  code: 1,
  signal: null
}

Could it be possible that this issue arises while running webpack, typescript, babel, (or something) else in watch mode, an whenever a checksum of a file changes, that this error is thrown?

I’ve tried with a project, that has a dependency linked with npm link. When i bundle my files, no error is throw. However, when i run my files through tsc to create .d.ts files, then the error is thrown. Even just changing a single thing in any definition file creates the error during watch mode.

I would be happy to see this issue being opened again.

@vocko @piotr-oles That patch seems to help, it didn’t crash since I updated the code, so it would probably be a good idea to create a PR with this fix.

Also having this issue with React CRA. My issue is very similar to @PenguinDetective . I have a linked dependency and when declaration files changed on that library (with tsc-watch) fork-ts-checker-webpack-plugin crash.