different-ai/openwork · error

projectDir is required

Error message

projectDir is required

What it means

Error "projectDir is required" thrown in different-ai/openwork.

Source

Thrown at apps/desktop/electron/runtime.mjs:247

}

function workspaceInaccessibleError(workspacePath, cause) {
  if (cause && typeof cause === "object" && cause.code === "workspace_inaccessible") return cause;
  const error = new Error(`Workspace path is not accessible: ${workspacePath}`, { cause });
  Object.defineProperties(error, {
    code: { value: "workspace_inaccessible", enumerable: true },
    workspacePath: { value: workspacePath, enumerable: true },
  });
  return error;
}

export async function prepareRuntimeWorkspaceRoot(projectDir, options = {}) {
  const rawProjectDir = String(projectDir ?? "").trim();
  try {
    const workspaceRoot = normalizeWorkspaceRootPath(rawProjectDir, {
      platform: options.platform ?? process.platform,
    });
    if (!workspaceRoot) throw new Error("projectDir is required");
    await (options.mkdirImpl ?? mkdir)(workspaceRoot, { recursive: true });
    if (typeof options.ensureConfig === "function") {
      await options.ensureConfig(workspaceRoot);
    }
    return workspaceRoot;
  } catch (error) {
    throw workspaceInaccessibleError(rawProjectDir, error);
  }
}

export function resolveOpenworkServerConfigPath(env = process.env) {
  return openworkServerConfigPath({ env });
}

export function seedWorkspacePathsForEmbeddedServer(workspacePaths, serverConfigExists) {
  return serverConfigExists ? [] : workspacePaths;
}

View on GitHub (pinned to 2b7df46e8a)

When it happens

Trigger: Thrown at apps/desktop/electron/runtime.mjs:247 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of different-ai/openwork@2b7df46e8a (2026-09-01). Data as JSON: /api/errors/377881fed6b7cba8. Report an issue: GitHub.