Skip to content

Commit 33f182a

Browse files
committed
Don't misuse first client reference manifest as "base"
1 parent a7b7ed7 commit 33f182a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/next/src/server/app-render/manifests-singleton.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type { ClientReferenceManifest } from '../../build/webpack/plugins/flight
33
import type { DeepReadonly } from '../../shared/lib/deep-readonly'
44
import { InvariantError } from '../../shared/lib/invariant-error'
55
import { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'
6-
import { ReflectAdapter } from '../web/spec-extension/adapters/reflect'
76
import { createServerModuleMap, type ServerModuleMap } from './action-utils'
87
import { workAsyncStorage } from './work-async-storage.external'
98

@@ -36,7 +35,6 @@ type ClientReferenceManifestMappingProp =
3635
const globalThisWithManifests = globalThis as GlobalThisWithManifests
3736

3837
function createProxiedClientReferenceManifest(
39-
baseManifest: DeepReadonly<ClientReferenceManifest>,
4038
clientReferenceManifestsPerRoute: Map<
4139
string,
4240
DeepReadonly<ClientReferenceManifest>
@@ -114,7 +112,7 @@ function createProxiedClientReferenceManifest(
114112
return new Proxy(
115113
{},
116114
{
117-
get(_, prop, receiver) {
115+
get(_, prop) {
118116
const workStore = workAsyncStorage.getStore()
119117

120118
switch (prop) {
@@ -154,7 +152,9 @@ function createProxiedClientReferenceManifest(
154152
return proxy
155153
}
156154
default: {
157-
return ReflectAdapter.get(baseManifest, prop, receiver)
155+
throw new InvariantError(
156+
`This is a proxied client reference manifest. The property "${String(prop)}" is not handled.`
157+
)
158158
}
159159
}
160160
},
@@ -191,7 +191,6 @@ export function setManifestsSingleton({
191191
>([[normalizeAppPath(page), clientReferenceManifest]])
192192

193193
const proxiedClientReferenceManifest = createProxiedClientReferenceManifest(
194-
clientReferenceManifest,
195194
clientReferenceManifestsPerRoute
196195
)
197196

0 commit comments

Comments
 (0)