makeplane/plane · error · Error

Workspace not found

Error message

Workspace not found

What it means

Thrown by updateWorkspaceLogo in the web workspace store when getWorkspaceBySlug(workspaceSlug) returns no workspace (or one without an id). The logo update is purely an optimistic local set on workspaces[workspaceId], so the workspace must already be in the store.

Source

Thrown at apps/web/core/store/workspace/index.ts:234

      if (res && res.id) {
        runInAction(() => {
          Object.keys(data).forEach((key) => {
            set(this.workspaces, [res.id, key], data[key as keyof IWorkspace]);
          });
        });
      }
      return res;
    });

  /**
   * update workspace using the workspace slug and new workspace data
   * @param {string} workspaceSlug
   * @param {string} logoURL
   */
  updateWorkspaceLogo = (workspaceSlug: string, logoURL: string) => {
    const workspaceId = this.getWorkspaceBySlug(workspaceSlug)?.id;
    if (!workspaceId) {
      throw new Error("Workspace not found");
    }
    runInAction(() => {
      set(this.workspaces[workspaceId], ["logo_url"], logoURL);
    });
  };

  /**
   * delete workspace using the workspace slug
   * @param workspaceSlug
   */
  deleteWorkspace = async (workspaceSlug: string) => {
    try {
      await this.workspaceService.deleteWorkspace(workspaceSlug);
      const updatedWorkspacesList = this.workspaces;
      const workspaceId = this.getWorkspaceBySlug(workspaceSlug)?.id;
      delete updatedWorkspacesList[`${workspaceId}`];
      runInAction(() => {
        this.workspaces = updatedWorkspacesList;

View on GitHub (pinned to 1c8a60f858)

Solutions

  1. Ensure fetchWorkspaces has completed (workspace in store) before enabling the logo upload.
  2. Validate the slug matches a known workspace; refetch if not.
  3. Pass the workspaceId directly when available instead of relying on slug lookup.
  4. Show an inline error in the logo UI instead of throwing.

Example fix

// before
const workspaceId = this.getWorkspaceBySlug(workspaceSlug)?.id;
if (!workspaceId) throw new Error("Workspace not found");
// after
const workspaceId = this.getWorkspaceBySlug(workspaceSlug)?.id;
if (!workspaceId) { await this.fetchWorkspaces(); return; }
Defensive patterns

Strategy: validation

Validate before calling

const workspaceId = workspaceStore.getWorkspaceBySlug(workspaceSlug)?.id;
if (!workspaceId) { await workspaceStore.fetchWorkspaces(); return; }

Type guard

const hasWorkspaceId = (w: unknown): w is { id: string } =>
  typeof w === 'object' && w !== null && typeof (w as any).id === 'string';

Try / catch

try { workspaceStore.updateWorkspaceLogo(workspaceSlug, logoURL); }
catch (e) { if (/Workspace not found/.test(e.message)) { await workspaceStore.fetchWorkspaces(); } else throw e; }

Prevention

When it happens

Trigger: Calling updateWorkspaceLogo before the workspace list has been fetched/loaded into the store; passing a workspaceSlug that does not match any known workspace (typo, wrong case, renamed slug); the workspace was deleted between list load and logo update.

Common situations: Workspace settings page opened via deep link before fetchWorkspaces resolves; slug taken from a stale URL after the workspace was renamed; cross-account confusion where the slug belongs to a workspace the user is no longer in.

Related errors


AI-assisted analysis of makeplane/plane@1c8a60f858 (2026-08-12). Data as JSON: /api/errors/9824429ab766120f. Report an issue: GitHub.