Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/run/handlers/cache.cts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,15 @@ export class NetlifyCacheHandler implements CacheHandlerForMultipleVersions {
typeof cacheControl !== 'undefined')
) {
try {
const { loadManifest } = await import('next/dist/server/load-manifest.js')
let loadManifest
try {
// @ts-expect-error Starting in 15.4.0-canary.10 loadManifest was relocated (https://github.com/vercel/next.js/pull/78358)
// eslint-disable-next-line @typescript-eslint/no-extra-semi, n/no-missing-import, import/no-unresolved
;({ loadManifest } = await import('next/dist/server/load-manifest.external.js'))
} catch {
// eslint-disable-next-line @typescript-eslint/no-extra-semi
;({ loadManifest } = await import('next/dist/server/load-manifest.js'))
}
const prerenderManifest = loadManifest(
join(this.options.serverDistDir, '..', 'prerender-manifest.json'),
) as PrerenderManifest
Expand Down
Loading