Skip to content

Commit 7c9828b

Browse files
BrewingCoderclaude
andcommitted
fix Next.js SDK type error: default undefined rewrites to empty arrays
Next.js 14 types require definite Rewrite[] arrays in the rewrites return type. The beforeFiles/afterFiles/fallback fields were potentially undefined. Default to [] to satisfy the type checker. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 799a965 commit 7c9828b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sdk/highlight-next/src/util/with-highlight-config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,11 @@ const getHighlightConfig = async (
172172
return {
173173
beforeFiles: defaultOpts.uploadSourceMaps
174174
? (re.beforeFiles ?? []).concat(sourcemapRewrite)
175-
: re.beforeFiles,
175+
: re.beforeFiles ?? [],
176176
afterFiles: defaultOpts.configureHighlightProxy
177177
? (re.afterFiles ?? []).concat(...highlightRewrites)
178-
: re.afterFiles,
179-
fallback: re.fallback,
178+
: re.afterFiles ?? [],
179+
fallback: re.fallback ?? [],
180180
}
181181
}
182182
}

0 commit comments

Comments
 (0)