@@ -3,7 +3,7 @@ import type { GetDynamicParamFromSegment } from '../../server/app-render/app-ren
3
3
import type { LoaderTree } from '../../server/lib/app-dir-module'
4
4
import type { CreateServerParamsForMetadata } from '../../server/request/params'
5
5
6
- import { Suspense , cache , cloneElement } from 'react'
6
+ import { cache , cloneElement } from 'react'
7
7
import {
8
8
AppleWebAppMeta ,
9
9
FormatDetectionMeta ,
@@ -38,7 +38,6 @@ import {
38
38
VIEWPORT_BOUNDARY_NAME ,
39
39
} from './metadata-constants'
40
40
import { AsyncMetadata } from './async-metadata'
41
- import { isPostpone } from '../../server/lib/router-utils/is-postpone'
42
41
43
42
// Use a promise to share the status of the metadata resolving,
44
43
// returning two components `MetadataTree` and `MetadataOutlet`
@@ -148,8 +147,8 @@ export function createMetadataComponents({
148
147
async function resolveFinalMetadata ( ) {
149
148
try {
150
149
return await metadata ( )
151
- } catch ( metadataErr ) {
152
- if ( ! errorType && isHTTPAccessFallbackError ( metadataErr ) ) {
150
+ } catch ( error ) {
151
+ if ( ! errorType && isHTTPAccessFallbackError ( error ) ) {
153
152
try {
154
153
return await getNotFoundMetadata (
155
154
tree ,
@@ -159,18 +158,7 @@ export function createMetadataComponents({
159
158
createServerParamsForMetadata ,
160
159
workStore
161
160
)
162
- } catch ( notFoundMetadataErr ) {
163
- // In PPR rendering we still need to throw the postpone error.
164
- // If metadata is postponed, React needs to be aware of the location of error.
165
- if ( isPostpone ( notFoundMetadataErr ) ) {
166
- throw notFoundMetadataErr
167
- }
168
- }
169
- }
170
- // In PPR rendering we still need to throw the postpone error.
171
- // If metadata is postponed, React needs to be aware of the location of error.
172
- if ( isPostpone ( metadataErr ) ) {
173
- throw metadataErr
161
+ } catch { }
174
162
}
175
163
// We don't actually want to error in this component. We will
176
164
// also error in the MetadataOutlet which causes the error to
@@ -180,15 +168,10 @@ export function createMetadataComponents({
180
168
}
181
169
}
182
170
async function Metadata ( ) {
183
- const promise = resolveFinalMetadata ( )
184
171
if ( serveStreamingMetadata ) {
185
- return (
186
- < Suspense fallback = { null } >
187
- < AsyncMetadata promise = { promise } />
188
- </ Suspense >
189
- )
172
+ return < AsyncMetadata promise = { resolveFinalMetadata ( ) } />
190
173
}
191
- return await promise
174
+ return await resolveFinalMetadata ( )
192
175
}
193
176
194
177
Metadata . displayName = METADATA_BOUNDARY_NAME
0 commit comments