remotion-dev/remotion · error · Error

The repository package ${packageName} does not expose ${subp

Error message

The repository package ${packageName} does not expose ${subpath} to Browser Studio.

What it means

resolveBrowserStudioWorkspacePackage resolves a monorepo (workspace) package import against that package's package.json exports map, including wildcard patterns. If no export matches the requested subpath, or the matched target does not start with './', it throws: the package does not expose that subpath to Browser Studio. This enforces the Node subpath-exports contract.

Source

Thrown at packages/browser-studio/src/workspace-package-exports.ts:72

			}

			const prefix = exportPattern.slice(0, wildcardIndex);
			const suffix = exportPattern.slice(wildcardIndex + 1);
			if (!subpath.startsWith(prefix) || !subpath.endsWith(suffix)) {
				continue;
			}

			const wildcard = subpath.slice(
				prefix.length,
				suffix.length === 0 ? undefined : -suffix.length,
			);
			target = exportTarget.replace('*', wildcard);
			break;
		}
	}

	if (!target || !target.startsWith('./')) {
		throw new Error(
			`The repository package ${packageName} does not expose ${subpath} to Browser Studio.`,
		);
	}

	const normalizedBaseUrl = baseUrl.endsWith('/') ? baseUrl : `${baseUrl}/`;
	return new URL(
		`${workspacePackage.packageRoot}/${target.slice(2)}`,
		normalizedBaseUrl,
	).href;
};

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Add the requested subpath to the package's package.json exports map with a relative (./) target.
  2. Import from a public subpath that is already exported.
  3. If using wildcard exports, add a './feature/*' pattern that matches the import.
  4. Ensure every export target begins with './' (relative).

Example fix

// before: package.json exports lacks './internals'
// "exports": { ".": "./dist/index.js" }
// import {x} from '@scope/pkg/internals';

// after
// "exports": { ".": "./dist/index.js", "./internals": "./dist/internals.js" }
Defensive patterns

Strategy: validation

Validate before calling

// Verify the subpath is exported before resolving
const isSubpathExported = (
  pkg: {exports: Record<string, string>},
  subpath: string,
): boolean => {
  if (pkg.exports[subpath]?.startsWith('./')) return true;
  return Object.entries(pkg.exports).some(([pattern, target]) => {
    const i = pattern.indexOf('*');
    if (i === -1 || !target.startsWith('./')) return false;
    const prefix = pattern.slice(0, i);
    const suffix = pattern.slice(i + 1);
    return subpath.startsWith(prefix) && subpath.endsWith(suffix);
  });
};

Type guard

const isExportedSubpath = (pkg: {exports: Record<string, string>}, subpath: string): boolean =>
  isSubpathExported(pkg, subpath);

Prevention

When it happens

Trigger: Importing a subpath of a workspace package that is not listed in its package.json 'exports' (and not matched by a wildcard pattern). Also if an export target is non-relative (does not start with './'), which Browser Studio cannot serve.

Common situations: Reaching into an internal/non-public module of a monorepo package; package.json exports misconfigured or missing a wildcard entry; an export target mistakenly set to an absolute/external path; new subpath added in source but not declared in exports.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/a29340e5930173fb. Report an issue: GitHub.