You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The composability issue of file directive and inline directive is hinted in #1336 for use server/cache, but this is already an issue with same use server directives. Before jumping too focused on use server/cache composition, we should evaluate the design for use server separately.
It may be a low priority if it's not used in practice, but it's good to be aware that there's a general Next.js transform approach divergence.
The built-in Server Function transform currently chooses between handling a module-level "use server" directive and handling inline "use server" directives. When a file has the module directive, it wraps the module exports but does not hoist and register explicitly annotated local functions inside those exports.
outer is exported and inherits the module-level role. inner is local, so it does not inherit that role, but its own inline directive explicitly declares it as a Server Function. The expected result is that outer and inner are independently registered Server Functions and that calling outer can return inner as a serializable server reference.
The current transform registers only outer. It leaves inner as an ordinary nested function, including the inert directive string in its body. Returning that function through React therefore does not produce a registered server reference.
Activity