Skip to content

🎥 Make videos programmatically with React

`@remotion/design`: Fix bundled client directives (#7193)

Igor Samokhovetsf66c51eb05b7
diff --git a/packages/design/bundle.ts b/packages/design/bundle.ts
index f58b37f4f2..32561685ee 100644
--- a/packages/design/bundle.ts
+++ b/packages/design/bundle.ts
@@ -33,7 +33,9 @@ if (!output.success) {
}
for (const file of output.outputs) {
- const str = await file.text();
+ // Work around Bun preserving nested directives when bundling dependencies:
+ // https://github.com/oven-sh/bun/issues/6854
+ const str = (await file.text()).replace(/^\s*['"]use client['"];\n?/gm, '');
const out = path.join('dist', 'esm', file.path);
await Bun.write(out, str);