{"record":{"id":"6ff418719179c99f","repo":"continuedev/continue","slug":"no-rootpath-provided-for-relative-file-path","errorCode":null,"errorMessage":"No rootPath provided for relative file path","messagePattern":"No rootPath provided for relative file path","errorType":"error_code","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/config-yaml/src/registryClient.ts","lineNumber":52,"sourceCode":"\n  private getContentFromFilePath(filepath: string): string {\n    if (filepath.startsWith(\"file://\")) {\n      // For Windows file:///C:/path/to/file, we need to handle it properly\n      // On other systems, we might have file:///path/to/file\n      return fs.readFileSync(new URL(filepath), \"utf8\");\n    } else if (path.isAbsolute(filepath)) {\n      return fs.readFileSync(filepath, \"utf8\");\n    } else {\n      // Try to resolve relative to current working directory first\n      const resolvedPath = path.resolve(filepath);\n      if (fs.existsSync(resolvedPath)) {\n        return fs.readFileSync(resolvedPath, \"utf8\");\n      }\n      // Fall back to rootPath if file doesn't exist relative to cwd\n      if (this.rootPath) {\n        return fs.readFileSync(path.join(this.rootPath, filepath), \"utf8\");\n      }\n      throw new Error(\"No rootPath provided for relative file path\");\n    }\n  }\n}\n","sourceCodeStart":34,"sourceCodeEnd":56,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/packages/config-yaml/src/registryClient.ts#L34-L56","documentation":"getContentFromFilePath resolves relative paths first against cwd; if the file isn't found there and no rootPath was supplied to the RegistryClient, it cannot resolve the relative path and throws.","triggerScenarios":"getContent with a relative fileUri where the file doesn't exist relative to the current working directory and the client was constructed without rootPath.","commonSituations":"Running the process from a different directory than assumed (CLI vs test cwd), constructing RegistryClient without the rootPath option, path typos making the cwd lookup miss.","solutions":["Pass rootPath when constructing the RegistryClient so relative block paths resolve deterministically","Or use absolute file paths in identifiers","Or run the process from the directory containing the referenced files"],"exampleFix":"// before\nnew RegistryClient({});\n// after\nnew RegistryClient({ rootPath: path.resolve(__dirname, 'blocks') });","handlingStrategy":"fallback","validationCode":"const resolved = path.resolve(rootPath ?? process.cwd(), fileUri);\nif (!fs.existsSync(resolved)) throw new Error(`Block file not found: ${resolved}`);","typeGuard":null,"tryCatchPattern":"try { await registry.getContent(id); } catch (e) { if (e.message === 'No rootPath provided for relative file path') { /* retry with absolute path */ } }","preventionTips":["Always pass rootPath when constructing the RegistryClient","Prefer absolute paths or paths relative to the config file","Make no assumptions about process.cwd()"],"tags":["filesystem","path","registry","cwd"],"backgroundTag":"relative-path-resolution-failed","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}