windmill-labs/windmill · error
No workspace available
Error message
No workspace available
What it means
getBackendProxyUrl() in the ATA (npm proxy) module builds the /api/w/<workspace>/npm_proxy URL from the current workspaceStore value. If no workspace is selected (store is empty/null), it throws 'No workspace available'. This is a guard ensuring npm-proxy requests are always workspace-scoped.
Source
Thrown at frontend/src/lib/ata/apis.ts:11
// https://github.com/jsdelivr/data.jsdelivr.com
import pLimit from 'p-limit'
import { workspaceStore } from '$lib/stores'
import { get } from 'svelte/store'
// Backend proxy fallback functions
const getBackendProxyUrl = () => {
const workspace = get(workspaceStore)
if (!workspace) {
throw new Error('No workspace available')
}
return `/api/w/${workspace}/npm_proxy`
}
const backendProxyApi = async <T>(endpoint: string, resLimit: ResLimit): Promise<T | Error> => {
if (isOverlimit(resLimit)) {
console.warn(
`Exceeded limit of types downloaded for the needs of the assistant fetching: ${endpoint}, ${resLimit.usage}`
)
return new Error('Exceeded limit of 100MB of data downloaded.')
}
try {
const baseUrl = getBackendProxyUrl()
const url = `${baseUrl}${endpoint}`
// `await`, not a bare `return`: an async function adopts a returned promise after
// leaving the try block, so a rejection would escape the catch below.View on GitHub (pinned to e474e8803c)
Solutions
- Ensure the calling page/component runs inside a workspace route so workspaceStore is populated before any npm-proxy request.
- Guard the request: check get(workspaceStore) first and skip or defer the call when empty.
- Fix the URL — if you navigated directly to a page without the /w/<workspace>/ prefix, navigate via the workspace-scoped route.
- If initialization is a race, wait for the workspace store to be set (await its load promise / subscribe until defined) before firing requests.
Example fix
// before const data = await backendProxyApi(endpoint, resLimit) // after const workspace = get(workspaceStore) if (!workspace) return // or queue until workspace is set const data = await backendProxyApi(endpoint, resLimit)
Defensive patterns
Strategy: type-guard
Validate before calling
const workspace = get(workspaceStore)
if (!workspace) {
// defer or skip npm-proxy request until a workspace is active
} Type guard
function hasActiveWorkspace(): boolean {
return get(workspaceStore) != null
} Try / catch
try {
const data = await backendProxyApi(endpoint, resLimit)
} catch (e) {
if (e instanceof Error && e.message === 'No workspace available') {
// re-run once workspaceStore is populated
} else throw e
} Prevention
- Mount npm-proxy-dependent components only inside workspace-scoped routes.
- Subscribe to workspaceStore and trigger fetches in an effect once a workspace exists.
- Check the URL contains /w/<workspace>/ before direct navigation.
When it happens
Trigger: Calling backendProxyApi-backed functions (baseUrl, res, proxyUrl paths) while workspaceStore is undefined/null — typically on a page outside a workspace context or before the workspace store is initialized from the URL.
Common situations: Rendering a component that auto-fetches ATA data before the router sets the workspace; using the component in an app preview/test context where no workspace is in scope; a stale or corrupted URL missing the workspace segment.
Related errors
- No model selected
- No workspace selected
- Workspace not found
- No git-sync repositories configured in workspace
- Unimplemented case
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/e0fa4027a399875d.
Report an issue: GitHub.