{"record":{"id":"a29340e5930173fb","repo":"remotion-dev/remotion","slug":"the-repository-package-packagename-does-not-exp","errorCode":null,"errorMessage":"The repository package ${packageName} does not expose ${subpath} to Browser Studio.","messagePattern":"The repository package (.+?) does not expose (.+?) to Browser Studio\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/browser-studio/src/workspace-package-exports.ts","lineNumber":72,"sourceCode":"\t\t\t}\n\n\t\t\tconst prefix = exportPattern.slice(0, wildcardIndex);\n\t\t\tconst suffix = exportPattern.slice(wildcardIndex + 1);\n\t\t\tif (!subpath.startsWith(prefix) || !subpath.endsWith(suffix)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst wildcard = subpath.slice(\n\t\t\t\tprefix.length,\n\t\t\t\tsuffix.length === 0 ? undefined : -suffix.length,\n\t\t\t);\n\t\t\ttarget = exportTarget.replace('*', wildcard);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (!target || !target.startsWith('./')) {\n\t\tthrow new Error(\n\t\t\t`The repository package ${packageName} does not expose ${subpath} to Browser Studio.`,\n\t\t);\n\t}\n\n\tconst normalizedBaseUrl = baseUrl.endsWith('/') ? baseUrl : `${baseUrl}/`;\n\treturn new URL(\n\t\t`${workspacePackage.packageRoot}/${target.slice(2)}`,\n\t\tnormalizedBaseUrl,\n\t).href;\n};\n","sourceCodeStart":54,"sourceCodeEnd":83,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/browser-studio/src/workspace-package-exports.ts#L54-L83","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Add the requested subpath to the package's package.json exports map with a relative (./) target.","Import from a public subpath that is already exported.","If using wildcard exports, add a './feature/*' pattern that matches the import.","Ensure every export target begins with './' (relative)."],"exampleFix":"// before: package.json exports lacks './internals'\n// \"exports\": { \".\": \"./dist/index.js\" }\n// import {x} from '@scope/pkg/internals';\n\n// after\n// \"exports\": { \".\": \"./dist/index.js\", \"./internals\": \"./dist/internals.js\" }","handlingStrategy":"validation","validationCode":"// Verify the subpath is exported before resolving\nconst isSubpathExported = (\n  pkg: {exports: Record<string, string>},\n  subpath: string,\n): boolean => {\n  if (pkg.exports[subpath]?.startsWith('./')) return true;\n  return Object.entries(pkg.exports).some(([pattern, target]) => {\n    const i = pattern.indexOf('*');\n    if (i === -1 || !target.startsWith('./')) return false;\n    const prefix = pattern.slice(0, i);\n    const suffix = pattern.slice(i + 1);\n    return subpath.startsWith(prefix) && subpath.endsWith(suffix);\n  });\n};","typeGuard":"const isExportedSubpath = (pkg: {exports: Record<string, string>}, subpath: string): boolean =>\n  isSubpathExported(pkg, subpath);","tryCatchPattern":null,"preventionTips":["Only import subpaths that are declared in the package's package.json exports.","When adding a new entry point, also add its subpath to exports.","Keep export targets relative (./...); Browser Studio cannot serve absolute/external targets.","Use wildcard exports ('./feature/*') for folders of importable modules."],"tags":["browser-studio","exports","package-json","resolution","monorepo"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}