mastra-ai/mastra · warning
tagWorker method is no longer supported. Use the Cloudflare
Error message
tagWorker method is no longer supported. Use the Cloudflare dashboard or API directly.
What it means
`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.
Source
Thrown at deployers/cloudflare/src/index.ts:330
async bundle(
entryFile: string,
outputDirectory: string,
{ toolsPaths, projectRoot }: { toolsPaths: (string | string[])[]; projectRoot: string },
): Promise<void> {
return this._bundle(this.getEntry(), entryFile, { outputDirectory, projectRoot, enableEsmShim: false }, toolsPaths);
}
async deploy(): Promise<void> {
this.logger?.info('Deploying to Cloudflare failed. Please use the Cloudflare dashboard to deploy.');
}
/**
* TODO: Remove this method in the next major version
*
* @deprecated
*/
async tagWorker(): Promise<void> {
throw new Error('tagWorker method is no longer supported. Use the Cloudflare dashboard or API directly.');
}
async lint(entryFile: string, outputDirectory: string, toolsPaths: (string | string[])[]): Promise<void> {
await super.lint(entryFile, outputDirectory, toolsPaths);
const hasLibsql = (await this.deps.checkDependencies(['@mastra/libsql'])) === `ok`;
if (hasLibsql) {
this.logger.error(
'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.',
);
process.exit(1);
}
}
}
View on GitHub (pinned to 75dd419e61)
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.
Example fix
// before
await deployer.tagWorker();
// after
// removed: use Cloudflare dashboard or REST API, e.g.
// PUT https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script}/tags Defensive patterns
Strategy: try-catch
Validate before calling
// Guard before calling: the method is a permanent deprecation stub
if (typeof (deployer as any).tagWorker === 'function') {
const src = (deployer as any).tagWorker.toString();
if (src.includes('no longer supported')) {
throw new Error('tagWorker is removed; use the Cloudflare dashboard/API instead.');
}
} Type guard
function tagWorkerSupported(d: unknown): boolean {
const fn = (d as any)?.tagWorker;
return typeof fn === 'function' && !fn.toString().includes('no longer supported');
} Try / catch
try {
await deployer.tagWorker();
} catch (err) {
if (err instanceof Error && err.message.includes('tagWorker method is no longer supported')) {
console.warn('tagWorker removed; applying tags via Cloudflare API instead.');
} else throw err;
} Prevention
- 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.
When it happens
Trigger: Any call to `deployer.tagWorker()` — the throw is unconditional, so even a well-formed call with valid credentials fails.
Common situations: 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.
Related errors
- execa is not available in Cloudflare Workers
- require(${specifier}) is not available in Cloudflare Workers
- data.errors[0].message
- getMetricsByType() has been removed: metricType is no longer
- MASTRA_SCORES_STORAGE_NOT_AVAILABLE
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/d7a417b61769140d.
Report an issue: GitHub.