remotion-dev/remotion · error · Error

Could not resolve ${dependency.name}

Error message

Could not resolve ${dependency.name}

What it means

After the Remotion version is fixed, each non-@remotion dependency must still resolve to a concrete version string. The requested version comes from dependency.version, optionally overridden by the dependencyResolver prop; if the resolver is absent, returns null, returns an http(s) URL string, or returns an object without a .version field, version stays null and this error is thrown naming the package.

Source

Thrown at packages/browser-studio/src/BrowserStudio.tsx:300

				const requestedVersion = dependency.name.startsWith('@remotion/')
					? remotionVersion
					: dependency.version;
				const customResolution = dependencyResolverRef.current?.({
					name: dependency.name,
					version: requestedVersion,
				});
				const customVersion =
					typeof customResolution === 'string' &&
					!customResolution.startsWith('http')
						? customResolution
						: typeof customResolution === 'object'
							? (customResolution?.version ?? null)
							: null;
				const version = dependency.name.startsWith('@remotion/')
					? remotionVersion
					: (customVersion ?? requestedVersion);
				if (version === null) {
					throw new Error(`Could not resolve ${dependency.name}`);
				}

				versions[dependency.name] = version;
				resolutions[dependency.name] = dependency.name.startsWith('@remotion/')
					? typeof customResolution === 'string' &&
						customResolution.startsWith('http')
						? customResolution
						: typeof customResolution === 'object' && customResolution?.url
							? {url: customResolution.url}
							: version
					: (customResolution ?? version);
			}

			installedDependencyResolutionsRef.current = {
				...installedDependencyResolutionsRef.current,
				...resolutions,
			};
			return Promise.resolve(versions);

View on GitHub (pinned to b2f4e34732)

Solutions

  1. Pass a concrete version string in each dependency entry: {name: 'lodash', version: '4.17.21'}.
  2. Implement the dependencyResolver prop to return {version: '...'} (or a URL string) for every non-@remotion dependency you support.
  3. Filter out optional dependencies with version null before calling installPackages.

Example fix

// before
installPackages({dependencies: [{name: 'lodash', version: null}]});

// after
installPackages({dependencies: [{name: 'lodash', version: '4.17.21'}]});
// or on the host:
<BrowserStudio dependencyResolver={({name}) => registry.lookup(name)} />
Defensive patterns

Strategy: validation

Validate before calling

const hasResolvableVersion = (
  dependency: {name: string; version: string | null},
  resolver: BrowserStudioDependencyResolver | undefined,
): boolean => {
  if (dependency.name.startsWith('@remotion/')) return true; // pinned internally
  if (dependency.version !== null) return true;
  const resolution = resolver?.({name: dependency.name, version: null});
  if (typeof resolution === 'string') return true; // treated as URL
  if (resolution && typeof resolution === 'object') {
    return resolution.version !== undefined || resolution.url !== undefined;
  }
  return false;
};

const installable = dependencies.filter((d) =>
  hasResolvableVersion(d, dependencyResolver),
);

Try / catch

try {
  await operations.packageInstallation.installPackages({dependencies});
} catch (error) {
  if (error instanceof Error && error.message.startsWith('Could not resolve ')) {
    const missing = dependencies.find((d) => d.version === null);
    // prompt the user for a version for `missing.name`, then retry
  }
}

Prevention

When it happens

Trigger: installPackages({dependencies: [{name: 'lodash', version: null}]}) with no dependencyResolver prop, or with a resolver that returns null / a URL string / {url} without version for that package.

Common situations: Remotion Element payloads that declare third-party dependencies without versions; hosts that only implement dependencyResolver for @remotion/* packages; resolver implementations that map everything to CDN URLs (URL strings are treated as resolutions, not versions, for non-Remotion packages).

Related errors


AI-assisted analysis of remotion-dev/remotion@b2f4e34732 (2026-08-22). Data as JSON: /api/errors/8bdee8a51497d1ca. Report an issue: GitHub.