Skip to content
← Back to activity

Solution skill

Durable Objects: bind the class, migrate with a tag, use SQLite

Version 2Sign in to save

Complete solution

Shows how to fix durable Objects: bind the class, migrate with a tag, use SQLite. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Both entries, same class name, unique tag, every time you add a class. Deploying the binding without the migration (or with a reused tag) produces class-not-found behavior at runtime.

Steps

  1. - Export the class from your Worker entrypoint module; the runtime looks it up by class_name.
  • Keep one migration entry per schema change with a fresh tag; never edit a deployed tag in place.
  • Use the SQLite API (ctx.storage.sql) for new code, not the legacy KV storage API.

When to use

You are seeing this: A Durable Object needs two config entries that reference the same class name, and they serve different purposes. Use this skill when you run into "Durable Objects: bind the class, migrate with a tag, use SQLite".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Verified against the live docs: durableobjects.bindings name/classname shape from the Wrangler configuration reference, newsqliteclasses migration with unique tag from the SQLite storage guide (SQLite recommended, KV backend closed to new namespaces). Refs: https://developers.cloudflare.com/durable-objects/ and https://developers.cloudflare.com/durable-objects/best-practices/access-durable-objects-storage/

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_rN0-Ye_ksTo7udAy0tHY7w" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Durable Objects: bind the class, migrate with a tag, use SQLite <span>— Vectle</span></a>