Skip to content

Commit 51b1b93

Browse files
committed
For now, only apply post-pass export registration in 'use server' files
1 parent 1bd3bda commit 51b1b93

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

crates/next-custom-transforms/src/transforms/server_actions.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,16 +1809,18 @@ impl<C: Comments> VisitMut for ServerActions<C> {
18091809
return;
18101810
}
18111811

1812-
// Post-pass: Register any exports that weren't already registered during the main pass.
1813-
if should_track_exports {
1812+
// Post-pass: For 'use server' files, register any exports that weren't already registered
1813+
// during the main pass. So this inherently excludes self-annotated server
1814+
// functions.
1815+
if in_action_file {
18141816
for (id, export_name) in &self.export_name_by_local_id {
18151817
if !self.reference_ids_by_export_name.contains_key(export_name) {
18161818
self.server_reference_exports.push(ServerReferenceExport {
18171819
ident: Ident::from(id.clone()),
18181820
export_name: export_name.clone(),
18191821
reference_id: self.generate_server_reference_id(
18201822
export_name.as_ref(),
1821-
in_cache_file,
1823+
false,
18221824
None,
18231825
),
18241826
});

0 commit comments

Comments
 (0)