PR #1911 was a fix for this in 2019 but is no longer compatible with the version of node required by our JS environment. It also overlaps with the test work done in PR #3510. We probably need a new PR that does what #1911 did but modernized and structured to fit with #3510.