mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +00:00
fix(nuxt): ignore fetch errors in getLatestManifest
(#26486)
This commit is contained in:
parent
67c664656c
commit
1dbd46ec99
@ -14,10 +14,14 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|||||||
const currentManifest = await getAppManifest()
|
const currentManifest = await getAppManifest()
|
||||||
if (timeout) { clearTimeout(timeout) }
|
if (timeout) { clearTimeout(timeout) }
|
||||||
timeout = setTimeout(getLatestManifest, 1000 * 60 * 60)
|
timeout = setTimeout(getLatestManifest, 1000 * 60 * 60)
|
||||||
const meta = await $fetch<NuxtAppManifestMeta>(buildAssetsURL('builds/latest.json') + `?${Date.now()}`)
|
try {
|
||||||
if (meta.id !== currentManifest.id) {
|
const meta = await $fetch<NuxtAppManifestMeta>(buildAssetsURL('builds/latest.json') + `?${Date.now()}`)
|
||||||
// There is a newer build which we will let the user handle
|
if (meta.id !== currentManifest.id) {
|
||||||
nuxtApp.hooks.callHook('app:manifest:update', meta)
|
// There is a newer build which we will let the user handle
|
||||||
|
nuxtApp.hooks.callHook('app:manifest:update', meta)
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
// fail gracefully on network issue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user