Skip to content

fix: log error in resolveEntrypointPath empty catch block #20

Description

@dapi

Problem

resolveEntrypointPath in cli.js has an empty catch {} block that silently swallows fs.realpathSync failures. If the file doesn't exist or permissions are wrong, the fallback to path.resolve masks the real issue, making startup failures hard to debug.

function resolveEntrypointPath(filePath) {
  if (!filePath) return null;
  try {
    return fs.realpathSync(filePath);
  } catch {
    return path.resolve(filePath);  // silently masks real errors
  }
}

Proposed Fix

Log the error to stderr before falling back:

catch (error) {
  process.stderr.write(`resolveEntrypointPath: realpathSync failed for ${filePath}: ${error.message}\n`);
  return path.resolve(filePath);
}

Context

Found during PR #18 review by silent-failure-hunter agent.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions