Skip to content

Docs: Note that bundle() does not delete its temporary directory - #13665

Draft
conorbronsdon wants to merge 1 commit into
remotion-dev:mainfrom
conorbronsdon:docs/bundle-temp-cleanup
Draft

conorbronsdon wants to merge 1 commit into
remotion-dev:mainfrom
conorbronsdon:docs/bundle-temp-cleanup

Conversation

@conorbronsdon

Copy link
Copy Markdown

When outDir is not passed, bundle() creates a new remotion-webpack-bundle-* folder in os.tmpdir() and nothing deletes it. The CLI removes its bundle through its own onDirectoryCreated cleanup hook, but the Node.js API docs don't say that callers have to do this themselves.

We hit this in a pipeline that called bundle() once per render (the anti-pattern the page already warns about). It left 1,970 stale bundle folders, 81 GB in total, in %TEMP% on Windows. Bundling once avoids most of it, but the one bundle still stays on disk after the process exits.

Changes to packages/docs/docs/bundle.mdx:

  • outDir?: say the temporary directory is not deleted, and link to the return value section.
  • Return value: say where the directory is created when outDir is not passed, with an example that bundles once, renders, and deletes the returned path in a finally block.

How this was checked against the source at 6a07b17:

The snippet uses the same imports and call shapes as the example in ssr-node.mdx. I couldn't run the docs build locally (this machine has Bun 1.3.14 and the repo requires 1.4.3 or later), so the twoslash block has not been type-checked. oxfmt@0.35.0 --check with the repo's .oxfmtrc.json passes on the changed file.

The example uses the return value rather than onDirectoryCreated. That means a bundle() call that throws partway through can still leave its folder behind. I left that case out to keep the note short.

🤖 Generated with Claude Code

Without `outDir`, `bundle()` creates a `remotion-webpack-bundle-*`
folder in `os.tmpdir()` and never removes it. Say so under `outDir`
and show deleting the returned path after rendering.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
bugs Ready Ready Preview Nov 28, 2026 11:18pm UTC
remotion Ready Ready Preview Nov 28, 2026 11:18pm UTC

Request Review

This branch was successfully deployed

2 active deployments
Preview – remotion — 08617aaa Deployed Nov 28, 2026 by vercel[bot]
Preview – bugs — 08617aaa Deployed Nov 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant