From fde267ca96952e40f51a010e082954000cae6511 Mon Sep 17 00:00:00 2001 From: "Randolf J." <34705014+jrandolf@users.noreply.github.com> Date: Mon, 23 Dec 2024 12:53:34 -0800 Subject: [PATCH] Fix `use server` diagnostics for type exports --- packages/next/src/server/typescript/rules/server-boundary.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/next/src/server/typescript/rules/server-boundary.ts b/packages/next/src/server/typescript/rules/server-boundary.ts index a71aec1de15373..943bb0c030f0b6 100644 --- a/packages/next/src/server/typescript/rules/server-boundary.ts +++ b/packages/next/src/server/typescript/rules/server-boundary.ts @@ -64,8 +64,11 @@ const serverBoundary = { const diagnostics: tsModule.Diagnostic[] = [] const exportClause = node.exportClause - if (exportClause && ts.isNamedExports(exportClause)) { + if (!node.isTypeOnly && exportClause && ts.isNamedExports(exportClause)) { for (const e of exportClause.elements) { + if (e.isTypeOnly) { + continue; + } if (!isFunctionReturningPromise(e, typeChecker, ts)) { diagnostics.push({ file: source,