Skip to content

Commit

Permalink
Fix a bug in the webpack-sources patch that happens sometimes when us…
Browse files Browse the repository at this point in the history
…ing the webpack cache (#67928)
  • Loading branch information
mknichel authored Jul 19, 2024
1 parent c175c24 commit 45928ce
Show file tree
Hide file tree
Showing 5 changed files with 212 additions and 109 deletions.
4 changes: 2 additions & 2 deletions packages/next/src/build/webpack-build/impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export async function webpackBuildImpl(
await runWebpackSpan.traceAsyncFn(async () => {
if (config.experimental.webpackMemoryOptimizations) {
stringBufferUtils.disableDualStringBufferCaching()
stringBufferUtils.enableStringInterning()
stringBufferUtils.enterStringInterningRange()
}

// Run the server compilers first and then the client
Expand Down Expand Up @@ -261,7 +261,7 @@ export async function webpackBuildImpl(
}

if (config.experimental.webpackMemoryOptimizations) {
stringBufferUtils.disableStringInterning()
stringBufferUtils.exitStringInterningRange()
}
inputFileSystem?.purge?.()

Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/compiled/webpack-sources3/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/next/types/$$compiled.internal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,9 @@ declare module 'next/dist/compiled/loader-utils3'
declare module 'next/dist/compiled/webpack-sources3' {
interface StringBufferUtils {
disableDualStringBufferCaching: () => boolean
disableStringInterning: () => boolean
enableDualStringBufferCaching: () => boolean
enableStringInterning: () => boolean
enterStringInterningRange: () => boolean
exitStringInterningRange: () => boolean
}
export let stringBufferUtils: StringBufferUtils
}
Expand Down
Loading

0 comments on commit 45928ce

Please sign in to comment.