diff --git a/packages/next/build/static-checker.ts b/packages/next/build/static-checker.ts index a8f9b5d3567f2..bfdfe9911c9d8 100644 --- a/packages/next/build/static-checker.ts +++ b/packages/next/build/static-checker.ts @@ -7,18 +7,6 @@ export default function worker( try { const { serverBundle, runtimeEnvConfig } = options || ({} as any) const result = isPageStatic(serverBundle, runtimeEnvConfig) - - // clear require.cache to prevent running out of memory - // since the cache is persisted by default - Object.keys(require.cache).map(modId => { - const mod = require.cache[modId] - delete require.cache[modId] - if (mod.parent) { - const idx = mod.parent.children.indexOf(mod) - mod.parent.children.splice(idx, 1) - } - }) - callback(null, result) } catch (error) { callback(error)