Unhandled rejection of `updateCallbackDone` when a navigation with a view transition fails · Issue #36626 · nuxt/nuxt · GitHub
Skip to content

Unhandled rejection of updateCallbackDone when a navigation with a view transition fails #36626

Description

@Satin3737

Environment

- Operating System: Linux 7.0.0
- Node.js: v24.15.0
- Nuxt: 4.6.1
- Nitro: 2.13.4
- Builder: vite@8.3.4
- Config: experimental.viewTransition: true
- Browsers: Chrome, Firefox

Reproduction

Minimal app with experimental.viewTransition: true:

<!-- app/pages/index.vue -->
<template>
  <NuxtLink to="/broken">Go to a page whose setup throws</NuxtLink>
</template>
<!-- app/pages/broken.vue -->
<script setup lang="ts">
await new Promise(resolve => setTimeout(resolve, 50))
throw createError({ status: 404, statusText: 'Not found', fatal: true })
</script>

<template>
  <div>never rendered</div>
</template>

Open /, click the link. The error page renders, and the console shows an unhandled promise rejection.

Describe the bug

When a client-side navigation that runs a view transition fails (router.onError, app:error or vue:error), view-transitions.client.ts aborts it with abortTransition(), which rejects the promise returned from the update callback with no reason. Per the View Transitions spec, a rejected update callback rejects updateCallbackDone as well as ready and finished. The plugin already catches finished (#34515) and ready (#35537), but updateCallbackDone stays unhandled, so the browser reports Uncaught (in promise) undefined.

This code path is not dev-only. Any navigation that fails during page setup triggers it.

Adding currentTransition.updateCallbackDone.catch(() => {}) next to the existing handlers fixes it. I verified this through a page:view-transition:start hook in the reproduction.

Additional context

No response

Logs

Uncaught (in promise) undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions