ruvnet/ruflo · error · Error

Import file not found

Error message

Import file not found: ${resolved}

What it means

importFrom() resolved the caller-supplied import path against cwd and the fs.existsSync check found no file there, so the import cannot proceed. Fires when an export was never created, was written to a different directory, or the path was typo'd. The full resolved path is included to show where the manager looked.

Solutions

  1. Verify the import file path exists before importing
  2. Use an absolute path or a path relative to the current working directory

Example fix

Verify the import file path exists before importing: check the path is correct and the file is readable, then retry the import command.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at v3/@claude-flow/cli/src/services/config-file-manager.ts:154 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/307034ca956d17a9. Report an issue: GitHub.

Appendix: source

Thrown at v3/@claude-flow/cli/src/services/config-file-manager.ts:154

    const targetPath = this.configPath ?? path.resolve(cwd, CONFIG_FILENAMES[0]);
    this.writeAtomic(targetPath, DEFAULT_CONFIG);
    this.config = { ...DEFAULT_CONFIG };
    this.configPath = targetPath;
    return targetPath;
  }

  /** Export config to a specific path */
  exportTo(cwd: string, exportPath: string): void {
    const config = this.getConfig(cwd);
    const resolved = path.resolve(cwd, exportPath);
    this.writeAtomic(resolved, config);
  }

  /** Import config from a specific path */
  importFrom(cwd: string, importPath: string): void {
    const resolved = path.resolve(cwd, importPath);
    if (!fs.existsSync(resolved)) {
      throw new Error(`Import file not found: ${resolved}`);
    }
    const content = fs.readFileSync(resolved, 'utf-8');
    let imported: Record<string, unknown>;
    try {
      imported = JSON.parse(content);
    } catch {
      throw new Error(`Invalid JSON in import file: ${resolved}`);
    }
    if (typeof imported !== 'object' || imported === null || Array.isArray(imported)) {
      throw new Error('Import file must contain a JSON object');
    }
    const targetPath = this.configPath ?? path.resolve(cwd, CONFIG_FILENAMES[0]);
    this.writeAtomic(targetPath, imported);
    this.config = imported;
    this.configPath = targetPath;
  }

  /** Get the path to the current config file */

View on GitHub (pinned to fa13ee4ad6)