diff --git a/packages/next/build/babel/preset.ts b/packages/next/build/babel/preset.ts index a244e4e00ae6b..95fa36aecfd5d 100644 --- a/packages/next/build/babel/preset.ts +++ b/packages/next/build/babel/preset.ts @@ -157,9 +157,7 @@ module.exports = ( helpers: true, regenerator: true, useESModules: supportsESM && presetEnvConfig.modules !== 'commonjs', - absoluteRuntime: (process.versions as any).pnp - ? __dirname - : undefined, + absoluteRuntime: process.versions.pnp ? __dirname : undefined, ...options['transform-runtime'], }, ],