Skip to content

🎥 Make videos programmatically with React

handle undefined being passed to staticFile()

Jonny Burgerb38ce2b3e4c8
diff --git a/packages/core/src/static-file.ts b/packages/core/src/static-file.ts
index a5be72a374..1dfccd5f1c 100644
--- a/packages/core/src/static-file.ts
+++ b/packages/core/src/static-file.ts
@@ -89,6 +89,14 @@ const encodeBySplitting = (path: string): string => {
* @see [Documentation](https://www.remotion.dev/docs/staticfile)
*/
export const staticFile = (path: string) => {
+ if (path === null) {
+ throw new TypeError('null was passed to staticFile()');
+ }
+
+ if (typeof path === 'undefined') {
+ throw new TypeError('undefined was passed to staticFile()');
+ }
+
if (path.startsWith('http://') || path.startsWith('https://')) {
throw new TypeError(
`staticFile() does not support remote URLs - got "${path}". Instead, pass the URL without wrapping it in staticFile(). See: https://remotion.dev/docs/staticfile-remote-urls`,
diff --git a/packages/it-tests/src/templates/publish.ts b/packages/it-tests/src/templates/publish.ts
index 756fbc8020..c8f758234a 100644
--- a/packages/it-tests/src/templates/publish.ts
+++ b/packages/it-tests/src/templates/publish.ts
@@ -10,7 +10,9 @@ const folders = CreateVideoInternals.FEATURED_TEMPLATES.filter(
const publish = async (template: Template) => {
const folder = path.join(
- process.cwd(),
+ __dirname,
+ '..',
+ '..',
'..',
template.templateInMonorepo as string,
);