You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After refactoring my project built with Corepack + Yarn 4.6 to ESM syntax including the type: "module" setting in package.json, no yarn commands work any more and throw an error:
Error: Dynamic require of "util" is not supported
I'm not particularly sure about the cause (Yarn tracks a similar issue: yarnpkg/berry#5831) but it only really seems to happen for me if I use Corepack to initialize Yarn within a blank Docker image.
On a system where global Yarn is using a .cjs file, all operations work as expected, so I'm leaning towards it being a Corepack issue, though I don't know either environment well enough to be sure. It could also be a combination of conflicting settings, I'm not sure.
After refactoring my project built with Corepack + Yarn 4.6 to ESM syntax including the
type: "module"
setting inpackage.json
, no yarn commands work any more and throw an error:Error: Dynamic require of "util" is not supported
I'm not particularly sure about the cause (Yarn tracks a similar issue: yarnpkg/berry#5831) but it only really seems to happen for me if I use Corepack to initialize Yarn within a blank Docker image.
On a system where global Yarn is using a
.cjs
file, all operations work as expected, so I'm leaning towards it being a Corepack issue, though I don't know either environment well enough to be sure. It could also be a combination of conflicting settings, I'm not sure.I also created a simple Docker example in this repository for easier replication: https://github.com/Supinic/test-corepack-yarn-esm
The text was updated successfully, but these errors were encountered: