From fa8a82399d7eed54350cea46542c1dc0be9a005a Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Thu, 18 May 2023 16:51:18 -0700 Subject: [PATCH] Remove custom handling for prebundled react env (#49954) This removes the previous handling for the prebundled react env we were setting in favor of https://github.com/vercel/vercel/pull/9974 We need to wait to land this until https://github.com/vercel/vercel/pull/9974 has been rolled Fixes: https://github.com/vercel/next.js/issues/49169 Fixes: https://github.com/vercel/next.js/issues/49753 x-ref: https://github.com/vercel/next.js/issues/48948 --- packages/next/src/build/index.ts | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/packages/next/src/build/index.ts b/packages/next/src/build/index.ts index 52e23564fe42..ac20cf60fb8b 100644 --- a/packages/next/src/build/index.ts +++ b/packages/next/src/build/index.ts @@ -301,23 +301,6 @@ export default async function build( NextBuildContext.appDir = appDir hasAppDir = Boolean(appDir) - if (isAppDirEnabled && hasAppDir) { - if ( - (!process.env.__NEXT_TEST_MODE || - process.env.__NEXT_TEST_MODE === 'e2e') && - ciEnvironment.hasNextSupport - ) { - const requireHook = require.resolve('../server/require-hook') - const contents = await promises.readFile(requireHook, 'utf8') - await promises.writeFile( - requireHook, - `process.env.__NEXT_PRIVATE_PREBUNDLED_REACT = '${ - config.experimental.serverActions ? 'experimental' : 'next' - }'\n${contents}` - ) - } - } - const isSrcDir = path .relative(dir, pagesDir || appDir || '') .startsWith('src')