Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ jobs:
name: 🖥️ Browser tests
runs-on: ubuntu-24.04-arm
container:
image: mcr.microsoft.com/playwright:v1.58.2-noble@sha256:6446946a1d9fd62d9ae501312a2d76a43ee688542b21622056a372959b65d63d
image: mcr.microsoft.com/playwright:v1.60.0-noble@sha256:9bd26ad900bb5e0f4dee75839e957a89ae89c2b7ab1e76050e559790e946b948

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand Down
18 changes: 17 additions & 1 deletion app/plugins/view-transitions.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ export default defineNuxtPlugin(nuxtApp => {
return promise
})

transition.finished.then(resetTransitionState)
transition.ready.catch(handleViewTransitionRejection)
transition.updateCallbackDone.catch(handleViewTransitionRejection)
transition.finished.catch(handleViewTransitionRejection).finally(resetTransitionState)

await nuxtApp.callHook('page:view-transition:start', transition)

Expand Down Expand Up @@ -89,3 +91,17 @@ function isSearchTransition(toPath: string, fromPath: string): boolean {
const paths = new Set([toPath, fromPath])
return paths.has('/') && paths.has('/search')
}

function handleViewTransitionRejection(error: unknown) {
if (!import.meta.dev || isExpectedViewTransitionRejection(error)) return

// oxlint-disable-next-line no-console -- dev-only diagnostics for unexpected transition failures
console.warn('[view-transitions] transition promise rejected', error)
}

function isExpectedViewTransitionRejection(error: unknown): boolean {
const name = error instanceof Error ? error.name : ''
const message = error instanceof Error ? error.message : String(error)

return name === 'AbortError' || message.includes('Transition was aborted')
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"@e18e/eslint-plugin": "0.4.1",
"@intlify/core-base": "11.3.0",
"@npm/types": "2.1.0",
"@playwright/test": "1.58.2",
"@playwright/test": "1.60.0",
"@storybook-vue/nuxt": "catalog:storybook",
"@storybook/addon-a11y": "catalog:storybook",
"@storybook/addon-docs": "catalog:storybook",
Expand Down
60 changes: 30 additions & 30 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading