Since it's moved to ESM, `require` isn't defined. This hotfix is just recreating `require` to workaround this issue.