Skip to content

🎥 Make videos programmatically with React

handle case of no public/ dir

Jonny Burger28034c0771d1
diff --git a/packages/bundler/src/read-recursively.ts b/packages/bundler/src/read-recursively.ts
index 89760834e2..97c89b285e 100644
--- a/packages/bundler/src/read-recursively.ts
+++ b/packages/bundler/src/read-recursively.ts
@@ -16,7 +16,13 @@ export const readRecursively = ({
limit: number;
}): StaticFile[] => {
const absFolder = path.join(startPath, folder);
+
+ if (!fs.existsSync(absFolder)) {
+ return [];
+ }
+
const files = fs.readdirSync(absFolder);
+
for (const file of files) {
if (output.length >= limit) {
break;