Skip to content

Commit 56e2ce9

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

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/next/errors.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,5 +950,6 @@
950950
"949": "Route %s errored during %s. These errors are normally ignored and may not prevent the route from prerendering but are logged here because build debugging is enabled.\n \nOriginal Error: %s",
951951
"950": "The manifests singleton was not initialized.",
952952
"951": "The client reference manifest for route \"%s\" does not exist.",
953-
"952": "Cannot access \"%s\" without a work store."
953+
"952": "Cannot access \"%s\" without a work store.",
954+
"953": "This is a proxied client reference manifest. The property \"%s\" is not handled."
954955
}

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)