Error: Dynamic require of "util" is not supported

Switching to a different version of yarn didn’t fix the issue. I had to disable the ENABLE_EXPERIMENTAL_COREPACK flag for it to start working. This also required me to switch over to using a yarnPath in my .yarnrc file and add the corresponding yarn binary to the repo.