usebruno/bruno · error · Error
workspace: ${dirPath} already exists and is not empty
Error message
workspace: ${dirPath} already exists and is not empty What it means
Error "workspace: ${dirPath} already exists and is not empty" thrown in usebruno/bruno.
Source
Thrown at packages/bruno-electron/src/ipc/workspace.js:67
type: 'default'
};
}
return config;
};
const registerWorkspaceIpc = (mainWindow, workspaceWatcher) => {
const lastOpenedWorkspaces = new LastOpenedWorkspaces();
ipcMain.handle('renderer:create-workspace',
async (event, workspaceName, workspaceFolderName, workspaceLocation) => {
try {
workspaceFolderName = sanitizeName(workspaceFolderName);
const dirPath = path.join(workspaceLocation, workspaceFolderName);
if (fs.existsSync(dirPath)) {
const files = fs.readdirSync(dirPath);
if (files.length > 0) {
throw new Error(`workspace: ${dirPath} already exists and is not empty`);
}
}
validateWorkspaceDirectory(dirPath);
if (!fs.existsSync(dirPath)) {
await createDirectory(dirPath);
}
await createDirectory(path.join(dirPath, 'collections'));
const workspaceUid = getWorkspaceUid(dirPath);
const isDefault = workspaceUid === 'default';
const workspaceConfig = createWorkspaceConfig(workspaceName);
await writeWorkspaceConfig(dirPath, workspaceConfig);
await writeFile(path.join(dirPath, '.gitignore'), DEFAULT_GITIGNORE);
View on GitHub (pinned to 9bdd81c7bd)
Solutions
- Choose an empty or new directory for the workspace.
- Empty the target directory if safe, then retry.
When it happens
Trigger: Thrown at packages/bruno-electron/src/ipc/workspace.js:67 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of usebruno/bruno@9bdd81c7bd (2026-08-13).
Data as JSON: /api/errors/f9793aeb2373a5c3.
Report an issue: GitHub.