{"record":{"id":"dcdd60302bae5736","repo":"tldraw/tldraw","slug":"could-not-find-the-worker-name-in-wrangler-output","errorCode":null,"errorMessage":"Could not find the worker name in wrangler output","messagePattern":"Could not find the worker name in wrangler output","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"internal/scripts/lib/deploy.ts","lineNumber":128,"sourceCode":"\t\t\tenv: {\n\t\t\t\tNODE_ENV: 'production',\n\t\t\t\t// wrangler needs CI=1 set to prevent it from trying to do interactive prompts\n\t\t\t\tCI: '1',\n\t\t\t},\n\t\t}\n\t)\n\n\tif (dryRun) return\n\n\tconst versionMatch = out.match(/Current Version ID: (.+)/)\n\tif (!versionMatch) {\n\t\tthrow new Error('Could not find the deploy ID in wrangler output')\n\t}\n\n\tconst workerNameMatch = out.match(/Uploaded ([^ ]+)/)\n\n\tif (!workerNameMatch) {\n\t\tthrow new Error('Could not find the worker name in wrangler output')\n\t}\n\n\tif (sentry) {\n\t\tconst release = `${sentry.environment ?? workerNameMatch[1]}.${versionMatch[1]}`\n\n\t\tconst sentryEnv = {\n\t\t\tSENTRY_AUTH_TOKEN: sentry.authToken,\n\t\t\tSENTRY_ORG: 'tldraw',\n\t\t\tSENTRY_PROJECT: sentry.project,\n\t\t}\n\n\t\t// create a sentry release:\n\t\tawait exec('yarn', ['run', '-T', 'sentry-cli', 'releases', 'new', release], {\n\t\t\tpwd: location,\n\t\t\tenv: sentryEnv,\n\t\t})\n\n\t\t// upload sourcemaps to the release:","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/tldraw/tldraw/blob/b31086b44731a7d1d9d46be4163ac8ef7417321d/internal/scripts/lib/deploy.ts#L110-L146","documentation":"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.","triggerScenarios":"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.","commonSituations":"Wrangler version upgrade changing output wording; deploying a Workers project that uses a different upload message; wrangler config issues causing unexpected output.","solutions":["Inspect the full wrangler output to see how the worker name is reported in the current version.","Update the regex /Uploaded ([^ ]+)/ to match the new output format.","Verify the wrangler version in use and check its changelog for output format changes.","If Sentry is not needed, consider making the worker name extraction optional."],"exampleFix":"// before\nconst workerNameMatch = out.match(/Uploaded ([^ ]+)/)\nif (!workerNameMatch) throw new Error('Could not find the worker name in wrangler output')\n\n// after — match multiple wrangler output formats\nconst workerNameMatch = out.match(/Uploaded ([^ ]+)/) ?? out.match(/Deployed ([^ ]+)/)\nif (!workerNameMatch) throw new Error(`Could not find the worker name in wrangler output. Output was:\\n${out}`)","handlingStrategy":"try-catch","validationCode":"function parseWranglerWorkerName(output: string): string {\n  const match = output.match(/Uploaded ([^ ]+)/) ?? output.match(/Deployed ([^ ]+)/)\n  if (!match) throw new Error(`Could not find the worker name in wrangler output:\\n${output}`)\n  return match[1]\n}","typeGuard":"function hasWorkerName(output: string): boolean {\n  return /(?:Uploaded|Deployed) [^ ]+/.test(output)\n}","tryCatchPattern":"try {\n  const workerName = parseWranglerWorkerName(out)\n} catch (e) {\n  console.error('Full wrangler output:', out)\n  throw e\n}","preventionTips":["Pin the wrangler version.","Log full output for debugging on parse failure.","Make Sentry release creation optional so worker name parsing isn't a hard blocker."],"tags":["deployment","wrangler","cloudflare","parsing","ci"],"backgroundTag":null,"analyzedSha":"b31086b44731a7d1d9d46be4163ac8ef7417321d","analyzedAt":"2026-08-12T17:05:39.947Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}