fix(postgres): await getWorld() before calling start()#45
Draft
VaguelySerious wants to merge 1 commit into
Draft
fix(postgres): await getWorld() before calling start()#45VaguelySerious wants to merge 1 commit into
VaguelySerious wants to merge 1 commit into
Conversation
`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>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getWorld()fromworkflow/runtimereturnsPromise<World>after the v2-flow merge — the world singleton became async (eager-processing changelog: "Async World Singleton Drift After Merge").postgres/instrumentation.tsstill 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");
Resolve the promise first, then call
start()on the resulting world.Test plan
pnpm buildsucceeds with the fix against latest workflow tarballs (workflow-tarballs-n5b4yau0p.labs.vercel.dev)🤖 Generated with Claude Code