Skip to content

Commit

Permalink
Fix use server diagnostics for type exports
Browse files Browse the repository at this point in the history
  • Loading branch information
jrandolf committed Dec 24, 2024
1 parent 7a47ed5 commit 5121176
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/next/src/server/typescript/rules/server-boundary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5121176

Please sign in to comment.