paperclipai/paperclip · error
Invalid template ' '. Expected one of
Error message
Invalid template '${template}'. Expected one of: ${VALID_TEMPLATES.join(", ")} What it means
Argument validation at the top of scaffoldPluginProject: options.template is not one of VALID_TEMPLATES (defaulting to "default" when omitted). The scaffolder only ships a fixed set of starter templates, so an unknown template string is rejected before any files are written.
Solutions
- Choose one of the listed valid templates.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/plugins/create-paperclip-plugin/src/index.ts:126 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of paperclipai/paperclip@a7e689b3c3 (2026-08-18).
Data as JSON: /api/errors/236ee5a8ecbb3c40.
Report an issue: GitHub.
Appendix: source
Thrown at packages/plugins/create-paperclip-plugin/src/index.ts:126
const tarballPath = path.join(sdkBundleDir, tarballFileName);
if (!fs.existsSync(tarballPath)) {
throw new Error(`Packed tarball was not created at ${tarballPath}`);
}
return tarballPath;
}
/**
* Generate a complete Paperclip plugin starter project.
*
* Output includes manifest/worker/UI entries, SDK harness tests, bundler presets,
* and a local dev server script for hot-reload workflow.
*/
export function scaffoldPluginProject(options: ScaffoldPluginOptions): string {
const template = options.template ?? "default";
if (!VALID_TEMPLATES.includes(template)) {
throw new Error(`Invalid template '${template}'. Expected one of: ${VALID_TEMPLATES.join(", ")}`);
}
if (!isValidPluginName(options.pluginName)) {
throw new Error("Invalid plugin name. Must be lowercase and may include scope, dots, underscores, or hyphens.");
}
if (options.category && !VALID_CATEGORIES.has(options.category)) {
throw new Error(`Invalid category '${options.category}'. Expected one of: ${[...VALID_CATEGORIES].join(", ")}`);
}
const outputDir = path.resolve(options.outputDir);
if (fs.existsSync(outputDir)) {
throw new Error(`Directory already exists: ${outputDir}`);
}
const displayName = options.displayName ?? makeDisplayName(options.pluginName);
const description = options.description ?? "A Paperclip plugin";
const author = options.author ?? "Plugin Author";View on GitHub (pinned to a7e689b3c3)