{"record":{"id":"edc746f203050404","repo":"prisma/prisma","slug":"shellname-re-exports-mapping-package-which","errorCode":null,"errorMessage":"${shellName} re-exports ${mapping.package}, which has no public shell mapping","messagePattern":"(.+?) re-exports (.+?), which has no public shell mapping","errorType":"exception","errorClass":"ShellConfigError","httpStatus":null,"severity":"error","filePath":"packages/0-config/tsdown/shell-build.ts","lineNumber":140,"sourceCode":"        }\n      }\n      aggregates.set(pkg.entry, expected);\n      const entryFile = addEntry(pkg.entry, `${pkg.entry}.ts`);\n      writeFileSync(\n        entryFile,\n        `${aggregated.map(({ specifier }) => `export * from '${specifier}';`).join('\\n')}\\n`,\n      );\n    }\n  }\n\n  // Forwarded surfaces: the generated modules import the sibling package by\n  // its internal name, which the rewrite plugin turns into that sibling's\n  // published entrypoint and marks external. Nothing is copied, so the\n  // forwarded modules stay single-instance across the whole install.\n  for (const mapping of shell.reexports ?? []) {\n    const source = lookup.get(mapping.package);\n    if (source === undefined) {\n      throw new ShellConfigError(\n        `${shellName} re-exports ${mapping.package}, which has no public shell mapping`,\n      );\n    }\n    if (source.shell === shellName) {\n      throw new ShellConfigError(\n        `${shellName} re-exports ${mapping.package}, which it already publishes directly`,\n      );\n    }\n    const hasSourceRootExport = Object.hasOwn(source.exports, '.');\n    if (mapping.root !== false && mapping.subpaths === undefined && !hasSourceRootExport) {\n      // No root export upstream: forward the sibling shell's synthesized\n      // package-level aggregate, which carries no default export.\n      const entryFile = addEntry(mapping.entry, `${mapping.entry}.ts`);\n      writeFileSync(entryFile, `export * from '${mapping.package}';\\n`);\n    }\n    const forwarded = mapping.subpaths;\n    if (forwarded !== undefined) {\n      const available = new Set(","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/prisma/prisma/blob/a20d61fb6f095e636e6420ac2871c24f2dece4bb/packages/0-config/tsdown/shell-build.ts#L122-L158","documentation":"For each entry in shell.reexports, shell-build looks up mapping.package in the internal-package table built from all shells. If no shell publishes that package, the reexport target does not exist as a single-instance module and the build throws. The rewrite plugin that turns '@internal/...' imports into published specifiers would have nothing to rewrite to.","triggerScenarios":"A reexport mapping references a package name that is not listed in any shell's packages array in @internal/publish-surface/shells; the package was renamed; the mapping was copy-pasted from another shell.","commonSituations":"Adding a reexport before adding the source package to its shell; removing a package from publicShells but leaving a dangling reexport; typo in the mapping.package value.","solutions":["Map the package into a shell first (add it to that shell's packages array in @internal/publish-surface/shells), then reference it from reexports.","If the reexport is stale (the package no longer exists), delete the mapping entry.","Confirm mapping.package matches the exact published name of the source package."],"exampleFix":"// before — reexports references an unmapped package\nreexports: [{ package: '@internal/missing', entry: 'missing' }]\n// Error: @prisma/orm-framework re-exports @internal/missing, which has no public shell mapping\n\n// after — add @internal/missing to some shell's packages[], or drop the reexport\nreexports: [{ package: '@internal/real', entry: 'real' }]","handlingStrategy":"validation","validationCode":"function assertReexportMapped(\n  packageName: string,\n  lookup: Map<string, InternalPackage>,\n): void {\n  if (!lookup.has(packageName)) {\n    throw new Error(\n      `${packageName} has no public shell mapping; add it to some shell's packages[] first`,\n    );\n  }\n}","typeGuard":"function isMappedPackage(name: string, lookup: Map<string, unknown>): boolean {\n  return lookup.has(name);\n}","tryCatchPattern":null,"preventionTips":["Register a package in some shell's packages[] before adding it to another shell's reexports.","Delete reexport entries when you retire the underlying package.","Lint the shell map in CI to catch dangling reexport references."],"tags":["build","config","shell","mapping"],"backgroundTag":null,"analyzedSha":"a20d61fb6f095e636e6420ac2871c24f2dece4bb","analyzedAt":"2026-08-11T15:42:48.797Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}