Skip to content

feat(cloudflare/dev): pass workflow classNames to the vite dev-server - #1

Open
bensenescu wants to merge 1 commit into
mainfrom
fix/dev-workflow-classnames
Open

feat(cloudflare/dev): pass workflow classNames to the vite dev-server#1
bensenescu wants to merge 1 commit into
mainfrom
fix/dev-workflow-classnames

Conversation

@bensenescu

@bensenescu bensenescu commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Moving a worker that has a Workflow from wrangler to alchemy, alchemy dev won't start:

Worker "workflows:RankCheck"'s binding "USER_WORKFLOW" refers to service
"user-worker" with a named entrypoint "RankCheck", but "user-worker" has no
such named entrypoint.

alchemy-run#707 added async Workflow bindings, but they only cover deploy. In dev, the vite module-runner needs the hosted workflow classNames so it can export a WorkflowEntrypoint wrapper for each. This collects the same-script workflow classNames in LocalWorkerProvider and passes them as worker.workflows, next to durableObjectNamespaces. Deploy is untouched.

Blocked by: bensenescu/cloudflare-tools#1 (adds RuntimeWorker.workflows).

alchemy-run#707 added async workflow bindings, but they only work for `deploy`.
`alchemy dev` fails at startup because the vite dev module-runner never
exports the hosted WorkflowEntrypoint classes:

  Worker "workflows:X"'s binding "USER_WORKFLOW" refers to service
  "user-worker" with a named entrypoint "X", but "user-worker" has
  no such named entrypoint.

Collect the same-script workflow classNames in the local worker provider
and pass them as `worker.workflows` to the cloudflare vite plugin, which
generates a `createWorkflowEntrypointWrapper(className)` export for each.

Pairs with the cloudflare-tools change that adds `RuntimeWorker.workflows`
+ the dev wrapper generation.
@bensenescu

Copy link
Copy Markdown
Owner Author

Merge-review verification

  • oxfmt ✅ and oxlint ✅ clean on the changed file.
  • Follows the repo pattern: the workflow-className collection + workflows: worker.workflows pass mirror the durableObjectNamespaces threading in the same function (buildConfigviteDev).
  • Coupling / merge order: requires the paired cloudflare-tools change (RuntimeWorker.workflows). Merge + release that first, bump the catalog: version, then this typechecks (standalone it errors only on that one missing field).
  • Tests: the suite is live-cloud deploy tests (ALCHEMY_PROFILE=testing) which don't run the vite dev module-runner, so a deploy test wouldn't cover this change. Verified end-to-end instead — the same two diffs run together in a real TanStack Start / Website.Vite app and alchemy dev boots + registers the workflows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant