{"record":{"id":"d7a417b61769140d","repo":"mastra-ai/mastra","slug":"tagworker-method-is-no-longer-supported-use-the-c","errorCode":null,"errorMessage":"tagWorker method is no longer supported. Use the Cloudflare dashboard or API directly.","messagePattern":"tagWorker method is no longer supported\\. Use the Cloudflare dashboard or API directly\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"deployers/cloudflare/src/index.ts","lineNumber":330,"sourceCode":"  async bundle(\n    entryFile: string,\n    outputDirectory: string,\n    { toolsPaths, projectRoot }: { toolsPaths: (string | string[])[]; projectRoot: string },\n  ): Promise<void> {\n    return this._bundle(this.getEntry(), entryFile, { outputDirectory, projectRoot, enableEsmShim: false }, toolsPaths);\n  }\n\n  async deploy(): Promise<void> {\n    this.logger?.info('Deploying to Cloudflare failed. Please use the Cloudflare dashboard to deploy.');\n  }\n\n  /**\n   * TODO: Remove this method in the next major version\n   *\n   * @deprecated\n   */\n  async tagWorker(): Promise<void> {\n    throw new Error('tagWorker method is no longer supported. Use the Cloudflare dashboard or API directly.');\n  }\n\n  async lint(entryFile: string, outputDirectory: string, toolsPaths: (string | string[])[]): Promise<void> {\n    await super.lint(entryFile, outputDirectory, toolsPaths);\n\n    const hasLibsql = (await this.deps.checkDependencies(['@mastra/libsql'])) === `ok`;\n\n    if (hasLibsql) {\n      this.logger.error(\n        'Cloudflare Deployer does not support @libsql/client (which may have been installed by @mastra/libsql) as a dependency. Please use Cloudflare D1 instead: @mastra/cloudflare-d1.',\n      );\n      process.exit(1);\n    }\n  }\n}\n","sourceCodeStart":312,"sourceCodeEnd":346,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/deployers/cloudflare/src/index.ts#L312-L346","documentation":"`tagWorker` on the Cloudflare deployer is a permanent deprecation stub: the method body unconditionally throws instead of doing any work. The underlying worker-tagging capability is no longer supported, so the library blocks the call and directs you to the Cloudflare dashboard or API. It will be removed in the next major version.","triggerScenarios":"Any call to `deployer.tagWorker()` — the throw is unconditional, so even a well-formed call with valid credentials fails.","commonSituations":"Older deploy scripts or CI pipelines that tagged workers after deploy; code copied from pre-migration examples; upgrading @mastra/deployers without updating tagWorker call sites.","solutions":["Remove the `tagWorker()` call from your deploy script/CI entirely.","If tagging is needed, use the Cloudflare dashboard or call the Cloudflare REST API directly to manage worker tags.","Pin the older deployer version only as a temporary measure while migrating."],"exampleFix":"// before\nawait deployer.tagWorker();\n// after\n// removed: use Cloudflare dashboard or REST API, e.g.\n// PUT https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script}/tags","handlingStrategy":"try-catch","validationCode":"// Guard before calling: the method is a permanent deprecation stub\nif (typeof (deployer as any).tagWorker === 'function') {\n  const src = (deployer as any).tagWorker.toString();\n  if (src.includes('no longer supported')) {\n    throw new Error('tagWorker is removed; use the Cloudflare dashboard/API instead.');\n  }\n}","typeGuard":"function tagWorkerSupported(d: unknown): boolean {\n  const fn = (d as any)?.tagWorker;\n  return typeof fn === 'function' && !fn.toString().includes('no longer supported');\n}","tryCatchPattern":"try {\n  await deployer.tagWorker();\n} catch (err) {\n  if (err instanceof Error && err.message.includes('tagWorker method is no longer supported')) {\n    console.warn('tagWorker removed; applying tags via Cloudflare API instead.');\n  } else throw err;\n}","preventionTips":["Remove tagWorker calls when upgrading the Cloudflare deployer; it throws unconditionally.","Read the deployer changelog for major-version removals before upgrading CI scripts.","Use the Cloudflare REST API or dashboard directly for worker tagging.","Wrap legacy deploy steps in feature checks rather than assuming methods work."],"tags":["cloudflare","deprecated","api-change"],"backgroundTag":"method-removed-deprecated","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}