[Bug]: processChild fails to initialize under certain conditions when a custom ESM loader is present
See original GitHub issueVersion
27.3.1
Steps to reproduce
- Clone https://github.com/kherock/jest-worker-spawn-bug
- please look through the README for additional context!
- this repo is using Yarn 3, however I can confirm that this issue isn’t Yarn-specific.
- Run the example worker script with the custom ESM loader:
yarn install
yarn worker-with-loader
Expected behavior
The worker should initialize and run the procedure.
Actual behavior
The worker misses the initialization message and hangs until something requests for it to be killed.
Additional context
This appears to be a timing-sensitive issue. I’ll try to test this on some other platforms when I have time. Also, since this uses --experimental-loader
, I suspect this might be a Node.js bug/quirk. However, the current use of ChildProcess.send
feels unsound.
I’ve also written up some more context in the reproduction repo readme:
https://github.com/kherock/jest-worker-spawn-bug/blob/main/README.md
Environment
System:
OS: macOS 11.5.2
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Binaries:
Node: 14.18.1 - ~/.volta/tools/image/node/14.18.1/bin/node
Yarn: 3.2.0-rc.3.git.20211110.hash-83311e1d4 - ~/.volta/tools/image/yarn/1.22.11/bin/yarn
npm: 6.14.15 - ~/.volta/tools/image/node/14.18.1/bin/npm
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
ExpressJs is return error `ERR_MODULE_NOT_FOUND` if I ...
If someone is still searching, I got this error using node ... In your case, create a folder called app with an index.js...
Read more >Using ES modules in Node.js - LogRocket Blog
Learn about the state of ES modules in Node today, including concerns realted to transitioning from and interoperability with CommonJS.
Read more >A Complete Guide to Winston Logging in Node.js - Better Stack
In this tutorial, we will explain how to install, set up, and use the Winston logger in a Node.js application. We'll go through...
Read more >Dynamic Distant Objects LOD - DynDOLOD - Nexus Mods
DynDOLOD is a set of simple tools based on xEdit/xLODGen to automatically create a Skyrim mod based on the load order which adds...
Read more >Documentation - ECMAScript Modules in Node.js - TypeScript
Interoperating between the two module systems brings large challenges, with many new features to juggle; however, support for ESM in Node.js is now ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://github.com/nodejs/node/pull/41221 has shipped in Node.js v16.14 and v17.4
This seems to be a known issue in Node.js https://github.com/nodejs/node/issues/39140 / https://github.com/nodejs/node/issues/37782 with a solution in https://github.com/nodejs/node/issues/37782#issuecomment-801330314