{"record":{"id":"7d0e920ba8e1acb2","repo":"pulumi/pulumi","slug":"failed-to-find-the-following-components-array-f","errorCode":null,"errorMessage":"Failed to find the following components: ${Array.from(componentNames).join(\", \")}.\nPlease ensure these components are properly imported to your package's entry point.","messagePattern":"Failed to find the following components: (.+?)\\.\nPlease ensure these components are properly imported to your package's entry point\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"sdk/nodejs/provider/experimental/analyzer.ts","lineNumber":166,"sourceCode":"                    const dNode = node as docNode;\n                    if (dNode?.jsDoc && dNode.jsDoc.length > 0) {\n                        const typeDocString = dNode.jsDoc.map((doc: typescript.JSDoc) => doc.comment).join(\"\\n\");\n                        if (typeDocString) {\n                            this.docStrings[node.name.text] = typeDocString;\n                        }\n                    }\n                }\n            });\n\n            // If we still have components to find, follow imports from this file\n            if (componentNames.size > 0) {\n                filesToProcess.push(...this.collectImportedFiles(sourceFile));\n            }\n        }\n\n        // Check if all components were found\n        if (componentNames.size > 0) {\n            throw new Error(`Failed to find the following components: ${Array.from(componentNames).join(\", \")}.\nPlease ensure these components are properly imported to your package's entry point.`);\n        }\n\n        return {\n            components: this.components,\n            typeDefinitions: this.typeDefinitions,\n            dependencies: this.dependencies,\n        };\n    }\n\n    private findProgramEntryPoint(): typescript.SourceFile {\n        // Helper to convert JS paths to TS paths and resolve them\n        const tryResolveSourceFile = (jsPath: string): typescript.SourceFile | undefined => {\n            let tsPath = jsPath.replace(/\\.js$/, \".ts\");\n            if (!path.isAbsolute(tsPath)) {\n                tsPath = path.join(this.dir, tsPath);\n            }\n            const sourceFile = this.program.getSourceFile(tsPath);","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/sdk/nodejs/provider/experimental/analyzer.ts#L148-L184","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\n// index.ts\nexport { MyComponent } from \"./src/my-component\"; // listed as 'MyComp'\n// after\nexport { MyComponent } from \"./src/my-component\"; // names match discovery","handlingStrategy":"validation","validationCode":"for (const n of componentNames) if (!(n in entryExports)) throw new Error(`${n} not exported from entry point`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Re-export every component from index.ts","Keep component list and exports in sync","Check tsconfig includes cover all component files"],"tags":["nodejs","analyzer","component-provider","module-resolution"],"backgroundTag":"component-not-found-analyzer","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}