MCPcopy
hub / github.com/vercel/next.js / getClientBuildManifest

Function getClientBuildManifest

packages/next/src/client/route-loader.ts:183–202  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

181// code branches that use the Build Manifest Callback and push them through
182// the Route Loader interface.
183export function getClientBuildManifest() {
184 if (self.__BUILD_MANIFEST) {
185 return Promise.resolve(self.__BUILD_MANIFEST)
186 }
187
188 const onBuildManifest = new Promise<Record<string, string[]>>((resolve) => {
189 // Mandatory because this is not concurrent safe:
190 const cb = self.__BUILD_MANIFEST_CB
191 self.__BUILD_MANIFEST_CB = () => {
192 resolve(self.__BUILD_MANIFEST!)
193 cb && cb()
194 }
195 })
196
197 return resolvePromiseWithTimeout(
198 onBuildManifest,
199 markAssetError(new Error('Failed to load client build manifest')),
200 devBuildPromise
201 )
202}
203
204interface RouteFiles {
205 scripts: (TrustedScriptURL | string)[]

Callers 6

getPageListMethod · 0.90
getMiddlewareDataFunction · 0.90
_bflMethod · 0.90
changeMethod · 0.90
prefetchMethod · 0.90
getFilesForRouteFunction · 0.70

Calls 5

markAssetErrorFunction · 0.85
resolveMethod · 0.65
resolveFunction · 0.50
cbFunction · 0.50

Tested by

no test coverage detected