Skip to content

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

Open
conorbronsdon wants to merge 2 commits into
remotion-dev:mainfrom
conorbronsdon:docs/bundle-temp-cleanup
Open

conorbronsdon wants to merge 2 commits into
remotion-dev:mainfrom
conorbronsdon:docs/bundle-temp-cleanup

Conversation

@conorbronsdon

@conorbronsdon conorbronsdon commented Nov 28, 2026 •

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 a short example that bundles once and deletes the returned path in a finally block.

How this was checked against the source at 6a07b17:

The snippet is a twoslash block. 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 docs build in CI is what type-checks it. 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 29, 2026 10:21pm UTC
remotion Ready Ready Preview Nov 29, 2026 10:21pm UTC

Request Review

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — Reviewed the documentation updates describing temporary bundle directory cleanup and showing a finally cleanup example.

  • outDir? documentation — Clarifies that Remotion leaves the temporary directory in place and links to the return value section.
  • Return value example — Shows rendering from the returned bundle path and removing that path after use.

Pullfrog  | View workflow run | Using gpt-6-luna | 𝕏

@conorbronsdon

Copy link
Copy Markdown
Author

(note that I do think this behavior is worth looking at from a product design standpoint, but the docs should reflect it accurately for now at least)

@conorbronsdon

Copy link
Copy Markdown
Author

Tightening this a bit but if you prefer the original up to you!

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

This branch was successfully deployed

2 active deployments
Preview – remotion — 0ffe5593 Deployed Nov 29, 2026 by vercel[bot]
Preview – bugs — 0ffe5593 Deployed Nov 29, 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