{"record":{"id":"0eed492cd6dfa409","repo":"davila7/claude-code-templates","slug":"cloudflare-component-files-not-found-at-compone","errorCode":null,"errorMessage":"Cloudflare component files not found at: ${componentsDir}","messagePattern":"Cloudflare component files not found at: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli-tool/src/index.js","lineNumber":2916,"sourceCode":"    try {\n      if (await fs.pathExists(componentsDir)) {\n        console.log(chalk.gray('📦 Using local Cloudflare component files...'));\n        console.log(chalk.dim(`   Source: ${componentsDir}`));\n        console.log(chalk.dim(`   Target: ${sandboxDir}`));\n\n        // Copy all files from cloudflare directory\n        await fs.copy(componentsDir, sandboxDir, {\n          overwrite: true\n        });\n\n        // Verify files were copied\n        const copiedFiles = await fs.readdir(sandboxDir);\n        console.log(chalk.dim(`   Copied ${copiedFiles.length} items`));\n        if (copiedFiles.length === 0) {\n          throw new Error('No files were copied from Cloudflare component directory');\n        }\n      } else {\n        throw new Error(`Cloudflare component files not found at: ${componentsDir}`);\n      }\n    } catch (error) {\n      spinner.fail(`Failed to install Cloudflare component: ${error.message}`);\n      throw error;\n    }\n\n    spinner.succeed('Cloudflare sandbox component installed successfully');\n\n    // Check for Node.js\n    const nodeSpinner = ora('Checking Node.js environment...').start();\n\n    try {\n      const { spawn } = require('child_process');\n\n      // Check Node.js version\n      const checkNode = () => {\n        return new Promise((resolve) => {\n          const check = spawn('node', ['--version'], { stdio: 'pipe' });","sourceCodeStart":2898,"sourceCodeEnd":2934,"githubUrl":"https://github.com/davila7/claude-code-templates/blob/a0851ed10c7c60463dac8cfaaca124cf32d5804d/cli-tool/src/index.js#L2898-L2934","documentation":"The installer resolves the Cloudflare component's files to a local componentsDir and checks it with fs.pathExists before copying. If that path does not exist, it throws with the resolved location. This means the CLI's packaged catalog references a component folder that is absent on disk.","triggerScenarios":"Installing a Cloudflare sandbox component whose folder was deleted or renamed in the repo but is still listed in components.json; or the npm package was built with an incomplete copy of cli-tool/components/.","commonSituations":"Catalog regenerated after moving a component without updating paths; stale cached npx package version that predates the reorg; component name typo that happens to resolve to a nonexistent path.","solutions":["Update to the latest CLI: npx claude-code-templates@latest --sandbox <name> (clear npx cache if needed: npx clear-npx-cache)","Verify the component exists in the repo at cli-tool/components/sandbox/cloudflare/<name> and that the catalog entry's path matches","If the path changed, run python scripts/generate_components_json.py and republish so paths are consistent","Double-check the exact component slug (kebab-case, correct category) against components.json"],"exampleFix":"// before\nthrow new Error(`Cloudflare component files not found at: ${componentsDir}`);\n// after — include the component name and a hint\nthrow new Error(`Cloudflare component '${componentData.name}' not found at ${componentsDir}. Run with @latest or verify the catalog entry.`);","handlingStrategy":"validation","validationCode":"const ok = await fs.pathExists(componentsDir) && (await fs.readdir(componentsDir)).length > 0;\nif (!ok) { console.error(`Missing or empty: ${componentsDir}`); process.exit(1); }","typeGuard":null,"tryCatchPattern":"try { /* install */ } catch (e) { if (/files not found at:/.test(e.message)) { /* suggest @latest or verify slug */ } throw e; }","preventionTips":["Verify the component slug against components.json before installing","Keep npx cache fresh; clear it when components reorganize"],"tags":["cloudflare","sandbox","missing-file","catalog"],"backgroundTag":"component-path-not-found","analyzedSha":"a0851ed10c7c60463dac8cfaaca124cf32d5804d","analyzedAt":"2026-08-28T14:11:56.058Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}