Budibase/budibase · error

Workspace app not found ${workspaceAppId}

Error message

Workspace app not found ${workspaceAppId}

What it means

toggleDisabled looks up the workspace app in the local store by _id before mutating it. If no app with the given id exists in store state, it throws immediately without touching the server, since the local edit flow requires the existing record.

Source

Thrown at packages/builder/src/stores/builder/workspaceApps.ts:184

    this.store.update(state => {
      return {
        ...state,
        workspaceApps: state.workspaceApps.filter(app => app._id !== id),
      }
    })

    const { deploymentStore } = await import("./deployment")

    await deploymentStore.publishApp()
    appStore.refresh()
  }

  async toggleDisabled(workspaceAppId: string, state: boolean) {
    const workspaceApp = get(this.store).workspaceApps.find(
      app => app._id === workspaceAppId
    )
    if (!workspaceApp) {
      throw new Error(`Workspace app not found ${workspaceAppId}`)
    }
    workspaceApp.disabled = state
    await this.edit({
      ...workspaceApp,
      disabled: state,
    })

    const { deploymentStore } = await import("./deployment")
    await deploymentStore.publishApp()
  }

  replaceDatasource(_id: string, workspaceApp: WorkspaceApp) {
    const index = get(this.store).workspaceApps.findIndex(
      x => x._id === workspaceApp._id
    )

    this.store.update(state => {
      state.workspaceApps[index] = workspaceApp

View on GitHub (pinned to a81a902e9a)

Solutions

  1. Fetch/refresh the workspace apps store before toggling
  2. Verify the workspaceAppId is a valid, existing app id
  3. Handle the app having been deleted — check existence first and surface a friendly message
  4. Reload the page or re-fetch the list if state is stale

Example fix

// before
await workspaceApps.toggleDisabled(id, false)
// after
const app = get(workspaceApps).workspaceApps.find(a => a._id === id)
if (!app) { await workspaceApps.fetch(); return }
await workspaceApps.toggleDisabled(id, false)
Defensive patterns

Strategy: validation

Validate before calling

const app = get(workspaceApps).workspaceApps.find(a => a._id === workspaceAppId)
if (!app) {
  await workspaceApps.fetch()
  return
}

Try / catch

try {
  await workspaceApps.toggleDisabled(id, state)
} catch (e) {
  if (e.message.startsWith("Workspace app not found")) {
    await workspaceApps.fetch()
  } else throw e
}

Prevention

When it happens

Trigger: Calling toggleDisabled(workspaceAppId, state) with an id that isn't in the store — wrong id, app deleted concurrently, or store never fetched/refreshed.

Common situations: Hard-coded or stale ids after deleting a workspace app; forgetting to await the initial fetch before toggling; multi-tab scenarios where another tab deleted the app; typo in id.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29). Data as JSON: /api/errors/47931d0ea84caf3d. Report an issue: GitHub.