continuedev/continue · error · Error

Profile ${profileId} not found

Error message

Profile ${profileId} not found

What it means

Defensive type check on the keyFile config option: when a truthy keyFile is supplied it must be a string filesystem path, because it is forwarded directly to google-auth-library's GoogleAuth({ keyFile }). Any non-string truthy value (object, buffer, number) is rejected.

Source

Thrown at core/config/ConfigHandler.ts:218

  // Ide settings change: refresh session and cascade refresh from the top
  async updateIdeSettings(ideSettings: IdeSettings) {
    this.abortCascade();
    await this.cascadeInit("IDE settings update");
  }

  // Profile id: check id validity, save selection, switch and reload
  async setSelectedProfileId(profileId: string) {
    if (
      this.currentProfile &&
      profileId === this.currentProfile.profileDescription.id
    ) {
      return;
    }
    const profile = this.profiles.find(
      (profile) => profile.profileDescription.id === profileId,
    );
    if (!profile) {
      throw new Error(`Profile ${profileId} not found`);
    }

    const workspaceId = await this.getWorkspaceId();
    const selectedProfiles =
      this.globalContext.get("lastSelectedProfileForWorkspace") ?? {};
    this.globalContext.update("lastSelectedProfileForWorkspace", {
      ...selectedProfiles,
      [workspaceId]: profileId,
    });

    this.currentProfile = profile;
    await this.reloadConfig("Selected profile changed");
  }

  // Bottom level of cascade: refresh the current profile
  // IMPORTANT - must always refresh when switching profiles
  // Because of e.g. MCP singleton and docs service using things from config
  // Could improve this

View on GitHub (pinned to 5522c6f44c)

Solutions

  1. Pass a filesystem path string: keyFile: '/secrets/sa.json'
  2. If you already have the key contents/object, use keyJson instead
  3. For remote secrets, download to a temp file or read it into keyJson

Example fix

// before
new VertexAIApi({ keyFile: JSON.parse(fs.readFileSync('sa.json','utf8')) });

// after
new VertexAIApi({ keyFile: 'sa.json' });
// or
new VertexAIApi({ keyJson: fs.readFileSync('sa.json','utf8') });
Defensive patterns

Strategy: validation

Validate before calling

if (cfg.keyFile !== undefined && typeof cfg.keyFile !== 'string') throw new TypeError('keyFile must be a path string');

Type guard

const isKeyFileConfig = (c: { keyFile?: unknown }): c is { keyFile: string } => typeof c.keyFile === 'string';

Prevention

When it happens

Trigger: Passing keyFile as a parsed JSON object (same shape you'd give keyJson), a Buffer, or a URL instead of a local path string.

Common situations: Developer confuses keyFile (path) with keyJson (contents) and passes the parsed credentials object to keyFile; or passes a remote/GS URL expecting the library to fetch it.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27). Data as JSON: /api/errors/e082031c3ff3c1ec. Report an issue: GitHub.