windmill-labs/windmill · error

Script "${path}" is not deployed; there is no newer version

Error message

Script "${path}" is not deployed; there is no newer version to rebase onto.

What it means

Thrown by rebaseScriptDraft when the script has a draft but no deployed version — rebase exists to port draft changes onto a deploy that moved ahead of the draft's fork base, and with no deploy there is no newer target. The draft is already based on the only state that exists, so rebasing is meaningless rather than merely impossible.

Source

Thrown at frontend/src/lib/components/copilot/chat/global/core.ts:6232

			return rebaseScriptDraft(args.path, ctx)
		case 'flow':
			return rebaseFlowDraft(args.path, ctx)
		case 'app':
			return rebaseAppDraft(args.path, ctx)
		default:
			throw new Error('rebase_draft currently supports scripts, flows, and apps.')
	}
}

async function rebaseScriptDraft(path: string, ctx: WriteDraftCtx): Promise<string> {
	const { workspace, toolId, toolCallbacks } = ctx

	const draft = await getGlobalDraft(workspace, 'script', path)
	if (!draft || typeof draft.value !== 'string' || !draft.language) {
		throw new Error(`No script draft found for "${path}".`)
	}
	if (!(await ScriptService.existsScriptByPath({ workspace, path }))) {
		throw new Error(`Script "${path}" is not deployed; there is no newer version to rebase onto.`)
	}

	const latest = await ScriptService.getScriptByPath({ workspace, path })
	const baseHash = draft.parentHash
	if (baseHash && baseHash === latest.hash) {
		const message = `Draft "${path}" is already based on the latest deployed version (${latest.hash}).`
		toolCallbacks.setToolStatus(toolId, { content: message })
		return JSON.stringify({ success: true, alreadyLatest: true, latest_hash: latest.hash, message })
	}

	toolCallbacks.setToolStatus(toolId, { content: `Rebasing draft "${path}" onto latest...` })

	// Capture the draft's own changes (vs its fork base) BEFORE discarding — this
	// diff is the only clean record of what to replay. Best-effort: if the base
	// version is gone, diff against empty so the full draft is surfaced.
	let baseContent = ''
	if (baseHash) {
		try {

View on GitHub (pinned to e474e8803c)

Solutions

  1. Deploy the script first; rebase only matters once a newer deploy exists
  2. Skip rebasing — the draft is already current, so just deploy the draft
  3. If you expected a deploy to exist, check you are targeting the right path and workspace
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at frontend/src/lib/components/copilot/chat/global/core.ts:6232 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/316bbd67ec5c9bf1. Report an issue: GitHub.