@remotion/bundler: Handle webpack cache corruption on low-memory machines#6886
@remotion/bundler: Handle webpack cache corruption on low-memory machines#6886JonnyBurger merged 2 commits intomainfrom
@remotion/bundler: Handle webpack cache corruption on low-memory machines#6886Conversation
When webpack's filesystem cache gets corrupted (e.g. due to low memory causing incomplete writes), bundling crashes with a TypeError in wasm-hash. Detect cache corruption errors and automatically clear the cache and retry once, instead of requiring manual deletion. Closes #6865 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@remotion/bundler: Fix webpack cache corruption on low-memory machines
@remotion/bundler: Fix webpack cache corruption on low-memory machines@remotion/bundler: Handle webpack cache corruption on low-memory machines
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Review
The implementation is focused and solves the stated problem well. Two minor observations, neither blocking:
Line 319–331: The enableCaching !== false guard is correct but subtle. When enableCaching is undefined (the default when not explicitly passed), it still triggers the retry. This is the right behavior (clearing a non-existent cache is harmless), but a comment noting this would help future readers.
No test coverage for the retry path. The test plan items are unchecked and no tests were added. Specifically, a unit or integration test that simulates a cache-corruption-like error and verifies the retry behavior would give confidence that this path works without requiring manual cache corruption. This is especially important since the recovery can only be triggered by a real corrupted cache state.
No blockers: the looksLikeCacheCorruption patterns are specific enough, the clearCache call correctly targets the production cache directory, and the retry correctly re-throws on persistent failure.
| return false; | ||
| } | ||
|
|
||
| const message = err.message + (err.stack ?? ''); |
There was a problem hiding this comment.
Optional: err.stack can be very long. Consider also passing err.cause if this error wraps another error, since the corruption signal could be in the cause rather than the direct stack.

Summary
wasm-hashTypeError), the cache is cleared and bundling is retried oncenode_modules/.cache/webpackto recoverCloses #6865
Test plan
enableCaching: false)node_modules/.cache/webpacktriggers automatic recovery🤖 Generated with Claude Code