Skip to content

fix(postgres): await getWorld() before calling start()#45

Draft
VaguelySerious wants to merge 1 commit into
mainfrom
peter/fix-postgres-instrumentation-async-world
Draft

fix(postgres): await getWorld() before calling start()#45
VaguelySerious wants to merge 1 commit into
mainfrom
peter/fix-postgres-instrumentation-async-world

Conversation

@VaguelySerious

Copy link
Copy Markdown
Member

Summary

getWorld() from workflow/runtime returns Promise<World> after the v2-flow merge — the world singleton became async (eager-processing changelog: "Async World Singleton Drift After Merge").

postgres/instrumentation.ts still calls .start?.() on the unresolved Promise, which crashes the production build:

```
Type error: Property 'start' does not exist on type 'Promise'.
3 | if (process.env.NEXT_RUNTIME !== "edge") {
4 | const { getWorld } = await import("workflow/runtime");

5 | await getWorld().start?.();
| ^
```

Resolve the promise first, then call start() on the resulting world.

Test plan

  • pnpm build succeeds with the fix against latest workflow tarballs (workflow-tarballs-n5b4yau0p.labs.vercel.dev)
  • CI green

🤖 Generated with Claude Code

`getWorld()` from `workflow/runtime` returns `Promise<World>` after the
v2-flow merge (the world singleton became async). The previous
`await getWorld().start?.()` calls `.start` on the unresolved Promise
and crashes the production build with:

  Type error: Property 'start' does not exist on type 'Promise<World>'.

Resolve the promise first, then call `start()` on the resulting world.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
birthday-card-generator Ready Ready Preview, Comment May 6, 2026 3:55am
flight-booking-app Ready Ready Preview, Comment May 6, 2026 3:55am

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