next.js
0722c225 - Fix workers on thread to not crash with napi-rs (#95281)

Commit
25 days ago
Fix workers on thread to not crash with napi-rs (#95281) We believed the workers were crashing due to issues related to node. We had code that guarded on which version of node you were using and warned that it was unstable. I was able to recreate the crashes regardless of node version or napi-rs version. I filed an issue with napi-rs https://github.com/napi-rs/napi-rs/issues/3357. This gets around the crashes we were seeing by making sure we don't drop things off isolate causing these bugs. I did explore writing some tests here, but I wasn't sure a good way to do that. I did make [jimmym/turbopack-loader-worker-changes-stress-test](https://github.com/vercel/next.js/tree/jimmym/turbopack-loader-worker-changes-stress-test) which has a nice little reproducing stress test that now passes. I wasn't sure if we'd want something like this checked in or not. But figure it is good for people to see. I probably do need to validate this with some existing apps out there that trigger the crash. But I did keep the default to the process workers for now, so impact should be minimal.
Author
Parents
Loading