pulumi/pulumi · error · Error
Failed to find the following components: ${Array.from(compon
Error message
Failed to find the following components: ${Array.from(componentNames).join(", ")}.
Please ensure these components are properly imported to your package's entry point. What it means
After walking the program's files, the analyzer checks whether every requested component name was found. Leftover names in componentNames mean the declared components were never encountered in the analyzed TypeScript program, so schema generation would silently omit them; the analyzer throws instead.
Source
Thrown at sdk/nodejs/provider/experimental/analyzer.ts:166
const dNode = node as docNode;
if (dNode?.jsDoc && dNode.jsDoc.length > 0) {
const typeDocString = dNode.jsDoc.map((doc: typescript.JSDoc) => doc.comment).join("\n");
if (typeDocString) {
this.docStrings[node.name.text] = typeDocString;
}
}
}
});
// If we still have components to find, follow imports from this file
if (componentNames.size > 0) {
filesToProcess.push(...this.collectImportedFiles(sourceFile));
}
}
// Check if all components were found
if (componentNames.size > 0) {
throw new Error(`Failed to find the following components: ${Array.from(componentNames).join(", ")}.
Please ensure these components are properly imported to your package's entry point.`);
}
return {
components: this.components,
typeDefinitions: this.typeDefinitions,
dependencies: this.dependencies,
};
}
private findProgramEntryPoint(): typescript.SourceFile {
// Helper to convert JS paths to TS paths and resolve them
const tryResolveSourceFile = (jsPath: string): typescript.SourceFile | undefined => {
let tsPath = jsPath.replace(/\.js$/, ".ts");
if (!path.isAbsolute(tsPath)) {
tsPath = path.join(this.dir, tsPath);
}
const sourceFile = this.program.getSourceFile(tsPath);View on GitHub (pinned to 793f7b2e16)
Solutions
- Import (or re-export) each listed component from the package's entry point (index.ts)
- Fix component name typos in the components list/exports
- Check tsconfig.json include/files so the component's source file is part of the analyzed program
- Verify the export statement exports the class itself, not just a namespace
Example fix
// before
// index.ts
export { MyComponent } from "./src/my-component"; // listed as 'MyComp'
// after
export { MyComponent } from "./src/my-component"; // names match discovery Defensive patterns
Strategy: validation
Validate before calling
for (const n of componentNames) if (!(n in entryExports)) throw new Error(`${n} not exported from entry point`); Prevention
- Re-export every component from index.ts
- Keep component list and exports in sync
- Check tsconfig includes cover all component files
When it happens
Trigger: Listing component names (explicitly or via entry-point discovery) that are not actually exported/defined in the files reachable from the entry point — e.g. component defined but never imported into the package entry point.
Common situations: Component file exists but is not imported/re-exported by index.ts; name typo in the component list; component exported only from a barrel file excluded by tsconfig.
Related errors
- componentNames cannot be empty - at least one component name
- string(ee.Stderr)
- No entry points found in ${this.dir}. Expected either 'expor
- Component '${componentName}' must have exactly one construct
- Component '${componentName}' constructor must have an 'args'
AI-assisted analysis of pulumi/pulumi@793f7b2e16 (2026-08-31).
Data as JSON: /api/errors/7d0e920ba8e1acb2.
Report an issue: GitHub.