moeru-ai/airi · error · Error

Unable to locate engines/stage-tamagotchi-godot/project.godo

Error message

Unable to locate engines/stage-tamagotchi-godot/project.godot from ${getElectronMainDirname()}.

What it means

Thrown after resolveGodotProjectPath walks up from getElectronMainDirname() looking for engines/stage-tamagotchi-godot/project.godot and never finds it (loop terminates when dirname(current) === current, i.e. filesystem root). This path is only used in development/unpackaged contexts where the Godot project source is expected to sit in the repo tree.

Source

Thrown at apps/stage-tamagotchi/src/main/services/airi/godot-stage/index.ts:290

  while (true) {
    const projectPath = resolve(currentDirectory, 'engines', 'stage-tamagotchi-godot')

    try {
      await access(join(projectPath, 'project.godot'))
      return projectPath
    }
    catch {}

    const parentDirectory = dirname(currentDirectory)
    if (parentDirectory === currentDirectory) {
      break
    }

    currentDirectory = parentDirectory
  }

  throw new Error(`Unable to locate engines/stage-tamagotchi-godot/project.godot from ${getElectronMainDirname()}.`)
}

// Packaged builds ship a pre-exported sidecar under Electron resources.
async function resolveExportedGodotBinary(): Promise<string | undefined> {
  const platform = process.platform
  let binaryName: string

  if (platform === 'win32') {
    binaryName = 'godot-stage.exe'
  }
  else if (platform === 'darwin') {
    binaryName = join('godot-stage.app', 'Contents', 'MacOS', 'godot-stage')
  }
  else {
    binaryName = 'godot-stage'
  }

  const binaryPath = join(process.resourcesPath, 'godot-stage', binaryName)

View on GitHub (pinned to 27111382b4)

Solutions

  1. Run the Electron dev app from the repository root so the upward search reaches engines/stage-tamagotchi-godot/project.godot.
  2. If the engines folder is a submodule, run git submodule update --init to restore project.godot.
  3. Confirm getElectronMainDirname() resolves into the repo tree (check the location helper).
  4. For packaged builds, ensure the code path used resolves the exported binary instead of the project file.
Defensive patterns

Strategy: validation

Validate before calling

import { existsSync } from 'node:fs'
import { join } from 'node:path'

function godotProjectExists(root: string): boolean {
  return existsSync(join(root, 'engines', 'stage-tamagotchi-godot', 'project.godot'))
}

Type guard

function godotProjectExists(root: string): boolean {
  return existsSync(join(root, 'engines', 'stage-tamagotchi-godot', 'project.godot'))
}

Prevention

When it happens

Trigger: Running the Electron dev build from a location whose ancestor directories do not contain engines/stage-tamagotchi-godot/project.godot — e.g. running from a copied/extracted subset of the repo, from a build output directory, or after the engines folder was moved/deleted.

Common situations: Cloning only part of the monorepo; running after a partial clean; the engines/stage-tamagotchi-godot submodule not being initialized; running the packaged app through a code path that should only execute in dev.

Related errors


AI-assisted analysis of moeru-ai/airi@27111382b4 (2026-08-12). Data as JSON: /api/errors/079a1ca12b7e7d00. Report an issue: GitHub.