Skip to content

Commit 55f8af4

Browse files
committed
Revert "app router: ensure static prefetch renders loading.js (#55950)"
This reverts commit ca57258.
1 parent 86f6a76 commit 55f8af4

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

packages/next/src/server/app-render/app-render.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,9 +1122,7 @@ export const renderToHTMLOrFlight: AppPageRender = (
11221122
getDynamicParamFromSegment,
11231123
query
11241124
),
1125-
isPrefetch &&
1126-
!Boolean(components.loading) &&
1127-
!hasLoadingComponentInTree(loaderTree)
1125+
isPrefetch && !Boolean(components.loading)
11281126
? null
11291127
: // Create component tree using the slice of the loaderTree
11301128
// @ts-expect-error TODO-APP: fix async component type
@@ -1147,9 +1145,7 @@ export const renderToHTMLOrFlight: AppPageRender = (
11471145

11481146
return <Component />
11491147
}),
1150-
isPrefetch &&
1151-
!Boolean(components.loading) &&
1152-
!hasLoadingComponentInTree(loaderTree)
1148+
isPrefetch && !Boolean(components.loading)
11531149
? null
11541150
: (() => {
11551151
const { layoutOrPagePath } =

test/e2e/app-dir/app/app/linking/about/loading.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/e2e/app-dir/app/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ createNextDescribe(
1818
).toBeTruthy()
1919
expect(
2020
await next.readFile('.next/server/app/linking/about.prefetch.rsc')
21-
).toContain('About loading...')
21+
).toBeTruthy()
2222
expect(
2323
await next.readFile(
2424
'.next/server/app/dashboard/deployments/breakdown.prefetch.rsc'

0 commit comments

Comments
 (0)