usebruno/bruno · error · Error

Workspace path not found

Error message

Workspace path not found

What it means

Second guard in saveWorkspaceDocs (actions.js:1013): the workspace object exists but workspace.pathname is falsy. Without a pathname there is no on-disk directory to write the docs file to, so the IPC call would fail. Bruno creates some workspaces (temp/default placeholders) with pathname: null (see actions.js:96).

Source

Thrown at packages/bruno-app/src/providers/ReduxStore/slices/workspaces/actions.js:1013

        // Load API specs when workspace config is updated
        await dispatch(loadWorkspaceApiSpecs(workspaceUid));
      } catch (error) {
      }
    }
  };
};

export const saveWorkspaceDocs = (workspaceUid, docs) => {
  return async (dispatch, getState) => {
    try {
      const workspace = getState().workspaces.workspaces.find((w) => w.uid === workspaceUid);
      if (!workspace) {
        throw new Error('Workspace not found');
      }

      if (!workspace.pathname) {
        throw new Error('Workspace path not found');
      }

      await ipcRenderer.invoke('renderer:save-workspace-docs', workspace.pathname, docs || '');

      dispatch(updateWorkspace({
        uid: workspaceUid,
        docs: docs
      }));

      return docs;
    } catch (error) {
      throw error;
    }
  };
};

export const createCollectionInWorkspace = (collectionName, collectionFolderName, collectionLocation, workspaceUid) => {
  return async (dispatch, getState) => {

View on GitHub (pinned to 9bdd81c7bd)

Solutions

  1. Only render the WorkspaceDocs editor for workspaces that have a truthy pathname.
  2. Resolve and persist the workspace pathname before enabling the Save action.
  3. Surface a user-facing message ('This workspace is not saved to disk') instead of throwing.

Example fix

// before
{workspace && <WorkspaceDocs workspace={workspace} />}

// after
{workspace?.pathname && <WorkspaceDocs workspace={workspace} />}
// plus, in the save handler:
if (!workspace.pathname) {
  toast.error('This workspace is not saved to disk');
  return;
}
Defensive patterns

Strategy: validation

Validate before calling

const selectWorkspacePathname = (state, uid) =>
  state.workspaces.workspaces.find((w) => w.uid === uid)?.pathname;

const pathname = selectWorkspacePathname(store.getState(), workspaceUid);
if (!pathname) {
  toast.error('This workspace is not saved to disk');
  return;
}

Type guard

const workspaceHasPath = (ws) => Boolean(ws && typeof ws.pathname === 'string' && ws.pathname.length > 0);

Try / catch

try {
  await dispatch(saveWorkspaceDocs(workspaceUid, docs));
} catch (e) {
  toast.error(e.message === 'Workspace path not found'
    ? 'This workspace is not saved to disk'
    : e.message);
}

Prevention

When it happens

Trigger: Saving docs for an in-memory/scratch/default workspace that was never assigned a pathname, or for a workspace whose pathname was cleared during a failed open or rename.

Common situations: Operating on the default workspace before it is resolved to a real path; corrupted state where pathname was dropped; workspace whose directory was moved/deleted externally.

Related errors


AI-assisted analysis of usebruno/bruno@9bdd81c7bd (2026-08-13). Data as JSON: /api/errors/5e5148b537d0058c. Report an issue: GitHub.