Skip to content

Commit

Permalink
fix(nuxt): ignore fetch errors in getLatestManifest (#26486)
Browse files Browse the repository at this point in the history
  • Loading branch information
michalzaq12 committed Mar 26, 2024
1 parent 67c6646 commit 1dbd46e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/nuxt/src/app/plugins/check-outdated-build.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ export default defineNuxtPlugin((nuxtApp) => {
const currentManifest = await getAppManifest()
if (timeout) { clearTimeout(timeout) }
timeout = setTimeout(getLatestManifest, 1000 * 60 * 60)
const meta = await $fetch<NuxtAppManifestMeta>(buildAssetsURL('builds/latest.json') + `?${Date.now()}`)
if (meta.id !== currentManifest.id) {
// There is a newer build which we will let the user handle
nuxtApp.hooks.callHook('app:manifest:update', meta)
try {
const meta = await $fetch<NuxtAppManifestMeta>(buildAssetsURL('builds/latest.json') + `?${Date.now()}`)
if (meta.id !== currentManifest.id) {
// 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
}
}

Expand Down

0 comments on commit 1dbd46e

Please sign in to comment.