tldraw/tldraw · error · Error

Could not find the worker name in wrangler output

Error message

Could not find the worker name in wrangler output

What it means

Thrown by wranglerDeploy after extracting the version ID when the 'wrangler deploy' output doesn't contain 'Uploaded <worker-name>'. The script parses the worker name from stdout to construct a Sentry release identifier. If wrangler's output format changed and no 'Uploaded' line appears, this error fires.

Source

Thrown at internal/scripts/lib/deploy.ts:128

			env: {
				NODE_ENV: 'production',
				// wrangler needs CI=1 set to prevent it from trying to do interactive prompts
				CI: '1',
			},
		}
	)

	if (dryRun) return

	const versionMatch = out.match(/Current Version ID: (.+)/)
	if (!versionMatch) {
		throw new Error('Could not find the deploy ID in wrangler output')
	}

	const workerNameMatch = out.match(/Uploaded ([^ ]+)/)

	if (!workerNameMatch) {
		throw new Error('Could not find the worker name in wrangler output')
	}

	if (sentry) {
		const release = `${sentry.environment ?? workerNameMatch[1]}.${versionMatch[1]}`

		const sentryEnv = {
			SENTRY_AUTH_TOKEN: sentry.authToken,
			SENTRY_ORG: 'tldraw',
			SENTRY_PROJECT: sentry.project,
		}

		// create a sentry release:
		await exec('yarn', ['run', '-T', 'sentry-cli', 'releases', 'new', release], {
			pwd: location,
			env: sentryEnv,
		})

		// upload sourcemaps to the release:

View on GitHub (pinned to b31086b447)

Solutions

  1. Inspect the full wrangler output to see how the worker name is reported in the current version.
  2. Update the regex /Uploaded ([^ ]+)/ to match the new output format.
  3. Verify the wrangler version in use and check its changelog for output format changes.
  4. If Sentry is not needed, consider making the worker name extraction optional.

Example fix

// before
const workerNameMatch = out.match(/Uploaded ([^ ]+)/)
if (!workerNameMatch) throw new Error('Could not find the worker name in wrangler output')

// after — match multiple wrangler output formats
const workerNameMatch = out.match(/Uploaded ([^ ]+)/) ?? out.match(/Deployed ([^ ]+)/)
if (!workerNameMatch) throw new Error(`Could not find the worker name in wrangler output. Output was:\n${out}`)
Defensive patterns

Strategy: try-catch

Validate before calling

function parseWranglerWorkerName(output: string): string {
  const match = output.match(/Uploaded ([^ ]+)/) ?? output.match(/Deployed ([^ ]+)/)
  if (!match) throw new Error(`Could not find the worker name in wrangler output:\n${output}`)
  return match[1]
}

Type guard

function hasWorkerName(output: string): boolean {
  return /(?:Uploaded|Deployed) [^ ]+/.test(output)
}

Try / catch

try {
  const workerName = parseWranglerWorkerName(out)
} catch (e) {
  console.error('Full wrangler output:', out)
  throw e
}

Prevention

When it happens

Trigger: The 'wrangler deploy' stdout doesn't contain a line matching 'Uploaded <name>'. This happens when wrangler's output format changes (e.g. it says 'Deployed' instead of 'Uploaded'), when the deploy uses a different command mode, or when wrangler errors are printed without a non-zero exit code.

Common situations: Wrangler version upgrade changing output wording; deploying a Workers project that uses a different upload message; wrangler config issues causing unexpected output.

Related errors


AI-assisted analysis of tldraw/tldraw@b31086b447 (2026-08-12). Data as JSON: /api/errors/dcdd60302bae5736. Report an issue: GitHub.