Error RpcIpcMessagePortClosedError
See original GitHub issueCurrent behavior
I stumbled upon an issue when running an editor Zettlr (https://github.com/Zettlr/Zettlr) and the issue seems to originate from fork-ts-checker-webpack-plugin module. This issue might be similar to https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/issues/562, however the steps to reproduce are different. Error message:
node:internal/process/promises:246
triggerUncaughtException(err, true /* fromPromise */);
^
RpcIpcMessagePortClosedError: Cannot send the message - the message port has been closed for the process 4492.
at /home/peter/code/Zettlr-3/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:47:47
at processTicksAndRejections (node:internal/process/task_queues:82:21) {
code: undefined,
signal: undefined
}
Expected behavior
Instead of Zettlr starting normally, the error message is displayed and Zettlr either fails to start or starts with a blank window.
Steps to reproduce the issue
mkdir Zettlr
git clone https://github.com/Zettlr/Zettlr.git Zettlr
cd Zettlr
yarn install --frozen-lockfile
yarn test-gui --clean --clear-cache
By default fork-ts-checker-webpack-plugin version 6.2.10 is installed. Above steps produce the error message shown above. The program then exists without starting the GUI of Zettlr or the Zettlr starts with a blank window. Several instances of this message appear each with a different process ID and the number of messages corresponds to the number of (virtual) CPU cores.
If I downgrade to fork-ts-checker-webpack-plugin version 6.2.2 with:
yarn add fork-ts-checker-webpack-plugin@6.2.2
and run Zettlr with the same command:
yarn test-gui --clean --clear-cache
the error doesn’t appear and Zettlr starts normally. I tried other version (6.2.3, 6.2.4 and 6.2.5) and sometimes it works (Zettlr starts without any error), sometimes it doesn’t (the above error is displayed).
I tested this on freshly installed Xubuntu in virtual machine and with the develop branch of Zettlr from github repo.
Issue reproduction repository
https://github.com/Zettlr/Zettlr, develop branch
Environment
- fork-ts-checker-webpack-plugin: 6.2.10
- typescript: 4.3.2
- eslint: 7.28.0
- webpack: 5.38.1
- os: Xubuntu 21.04 in the virtual machine
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:5
Top Related StackOverflow Question
I have a similar problem I want to share. Maybe its helpful to figure out what is the problem is. For this I will provide my setup here.
I came here from usage of nx running a node application. For development setup we run
npm start(translates to)nx serve --runtimeArgs=--max-old-space-size=8192 --verbosewhich is doing a hot reload. I also added a DEBUG=* hoping to see something. Output is:here I changed a file and saved it.
The whole process is running in a docker container.
Dockerfile.development:docker_compose.yml
command to start:
My current “fix” is to add the
restart: unless-stoppedflag to the docker-compose, so at least it restarts after the crash.My current assumption is, that there is a restriction in the IPC inside the docker (this is wild guess!). But maybe somebody with a deeper knowledge about this can see some connection I miss here.
Last note: The Issue disappears if the nx process is not running inside a docker container.
Thank you for the reply. I was testing it some more this afternoon and figured out I underestimated memory usage. Increasing RAM for the said virtual machine past 4 GB and increasing the swapfile helped and I am not getting this error any more. I apologize for opening the issue, since it is clear now, after solving the issue, that the problem was in my environement and not in the fork-ts-checker-webpack-plugin.