{"record":{"id":"84886d647ac1344a","repo":"EveryInc/compound-engineering-plugin","slug":"target-targetname-did-not-return-a-bundle-84886d","errorCode":null,"errorMessage":"Target ${targetName} did not return a bundle.","messagePattern":"Target (.+?) did not return a bundle\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/commands/install.ts","lineNumber":168,"sourceCode":"        if (activeTargets.some((t) => t.name === \"codex\")) {\n          await stripCodexAgentsToolMap(codexHome)\n        }\n        return\n      }\n\n      const target = targets[targetName]\n      if (!target) {\n        throw new Error(`Unknown target: ${targetName}`)\n      }\n      if (!target.implemented) {\n        throw new Error(`Target ${targetName} is registered but not implemented yet.`)\n      }\n\n      const resolvedScope = validateScope(targetName, target, args.scope ? String(args.scope) : undefined)\n\n      const bundle = target.convert(plugin, options)\n      if (!bundle) {\n        throw new Error(`Target ${targetName} did not return a bundle.`)\n      }\n      const primaryOutputRoot = resolveTargetOutputRoot({\n        targetName,\n        outputRoot,\n        codexHome,\n        piHome,\n        pluginName: plugin.manifest.name,\n        hasExplicitOutput,\n        scope: resolvedScope,\n      })\n      const effectiveScope =\n        targetName === \"opencode\" ? resolveOpenCodeWriteScope(hasExplicitOutput, resolvedScope) : resolvedScope\n      await target.write(primaryOutputRoot, bundle, effectiveScope)\n      console.log(`Installed ${plugin.manifest.name} to ${primaryOutputRoot}`)\n\n      const extraTargets = parseExtraTargets(args.also)\n      const allTargets = [targetName, ...extraTargets]\n      for (const extra of extraTargets) {","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/EveryInc/compound-engineering-plugin/blob/c9c10f8c75412c7232cb2bd663e5fd1cea98d84e/src/commands/install.ts#L150-L186","documentation":"After the target handler passes the implemented check, `install` calls `target.convert(plugin, options)`. A handler may return null (the TargetHandler type allows `TBundle | null`) when conversion cannot produce a bundle — for example when the plugin has nothing convertible for that target. The command throws this error because a null bundle means there is nothing to write.","triggerScenarios":"Calling `install` against a target whose convert() returns null for the given plugin — e.g. a converter that bails on a plugin with no agents/skills of the kind it maps, or a bug in a custom converter returning null instead of a valid bundle.","commonSituations":"Installing a minimal or empty plugin (no convertible content) into a target whose converter yields null; developing a new target writer whose convert step returns null on edge cases; converter regression after a parser change.","solutions":["Inspect the plugin source: confirm it contains content the target can convert (agents, skills, commands, etc.).","Try a different --to target (e.g. opencode) to see whether the plugin converts at all.","If writing a custom target handler, return an empty-but-valid bundle instead of null, or document that null means 'nothing to install'.","Update the CLI/converter if a recent change made conversion return null for a previously-convertible plugin."],"exampleFix":"// before (custom handler)\nconvert: (plugin) => plugin.agents.length ? convert(plugin) : null\n// after\nconvert: (plugin) => convert(plugin) // always produce a bundle; writer skips empty sections","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await install(plugin, { to: target })\n} catch (e) {\n  if (e instanceof Error && e.message.includes(\"did not return a bundle\")) {\n    console.error(`Plugin has nothing convertible for ${target}; check its agents/skills or try --to opencode`)\n  } else throw e\n}","preventionTips":["Ensure the plugin contains content the target maps (agents, skills, commands).","Sanity-check unfamiliar plugins with `--to opencode` first.","When authoring custom target handlers, never return null for valid input; return an empty bundle.","Keep converters in sync with parser changes."],"tags":["cli","conversion","null-bundle"],"backgroundTag":"empty-conversion-result","analyzedSha":"c9c10f8c75412c7232cb2bd663e5fd1cea98d84e","analyzedAt":"2026-08-31T15:18:07.959Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}