[go: nahoru, domu]

Skip to content

Commit

Permalink
fix non static check for not-found route in Next.js 14.2 (#7012)
Browse files Browse the repository at this point in the history
  • Loading branch information
leoortizz committed Apr 18, 2024
1 parent 26b8393 commit ae1562d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- fix non static check for not-found route in Next.js 14.2 (#7012)
10 changes: 5 additions & 5 deletions src/frameworks/next/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,11 @@ export async function build(
dynamicRoutes,
);

if (
unrenderedServerComponents.has("/_not-found") &&
(await hasStaticAppNotFoundComponent(dir, distDir))
) {
unrenderedServerComponents.delete("/_not-found");
const notFoundPageKey = ["/_not-found", "/_not-found/page"].find((key) =>
unrenderedServerComponents.has(key),
);
if (notFoundPageKey && (await hasStaticAppNotFoundComponent(dir, distDir))) {
unrenderedServerComponents.delete(notFoundPageKey);
}

for (const key of unrenderedServerComponents) {
Expand Down

0 comments on commit ae1562d

Please sign in to comment.