Skip to content

Commit 45928ce

Browse files
authored
Fix a bug in the webpack-sources patch that happens sometimes when using the webpack cache (#67928)
1 parent c175c24 commit 45928ce

File tree

5 files changed

+212
-109
lines changed

5 files changed

+212
-109
lines changed

packages/next/src/build/webpack-build/impl.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export async function webpackBuildImpl(
188188
await runWebpackSpan.traceAsyncFn(async () => {
189189
if (config.experimental.webpackMemoryOptimizations) {
190190
stringBufferUtils.disableDualStringBufferCaching()
191-
stringBufferUtils.enableStringInterning()
191+
stringBufferUtils.enterStringInterningRange()
192192
}
193193

194194
// Run the server compilers first and then the client
@@ -261,7 +261,7 @@ export async function webpackBuildImpl(
261261
}
262262

263263
if (config.experimental.webpackMemoryOptimizations) {
264-
stringBufferUtils.disableStringInterning()
264+
stringBufferUtils.exitStringInterningRange()
265265
}
266266
inputFileSystem?.purge?.()
267267

packages/next/src/compiled/webpack-sources3/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/next/types/$$compiled.internal.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -453,9 +453,9 @@ declare module 'next/dist/compiled/loader-utils3'
453453
declare module 'next/dist/compiled/webpack-sources3' {
454454
interface StringBufferUtils {
455455
disableDualStringBufferCaching: () => boolean
456-
disableStringInterning: () => boolean
457456
enableDualStringBufferCaching: () => boolean
458-
enableStringInterning: () => boolean
457+
enterStringInterningRange: () => boolean
458+
exitStringInterningRange: () => boolean
459459
}
460460
export let stringBufferUtils: StringBufferUtils
461461
}

0 commit comments

Comments
 (0)