mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #731] [CLOSED] [codex] Fix wrapped use server exports #803
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#803
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/731
Author: @southpolesteve
Created: 3/31/2026
Status: ❌ Closed
Base:
main← Head:codex/issue-722-next-safe-action📝 Commits (1)
6df0a2afix wrapped use server exports📊 Changes
3 files changed (+353 additions, -0 deletions)
View changed files
📝
packages/vinext/src/index.ts(+4 -0)➕
packages/vinext/src/plugins/fix-use-server-wrapped-exports.ts(+235 -0)➕
tests/use-server-wrapped-exports.test.ts(+114 -0)📄 Description
Summary
Fix file-level
"use server"exports that wrap an inline async action, such asnext-safe-action'sactionClient.action(async () => ...)pattern.Root Cause
@vitejs/plugin-rscvalidates file-level"use server"exports syntactically and rejects wrapped exports whose initializer is a call expression instead of a direct async function expression. That causes vinext to fail withunsupported non async functionfor valid Next.js-compatible patterns.Changes
"use server"exports into local bindings plusexport { ... }@vitejs/plugin-rscnext-safe-actionshape and the upstream strict proxy transform behaviorValidation
pnpm test tests/use-server-wrapped-exports.test.ts tests/use-server-closure-collision.test.tspnpm run checkvinext, linked it into the reporter's repro app from issue #722, and confirmedGET /changed from500 unsupported non async functionto200Closes #722.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.