Skip to content

Commit

Permalink
fix: fix: handle error when fast navigate https://github.com/nuxt/fra…
Browse files Browse the repository at this point in the history
  • Loading branch information
viandwi24 committed Jun 28, 2022
1 parent 0b97416 commit 5134a99
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions utils/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@ export function AppSetup() {
// use language manager
const languageManager = LanguageManager()

// vue transition bug handle
const messages = [
`Uncaught NotFoundError: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.`, // chromium based
`NotFoundError: The object can not be found here.`, // safari
]
if (typeof window !== 'undefined') {
window.addEventListener('error', (ev) => {
if (messages.includes(ev.message)) {
ev.preventDefault()
window.location.reload()
}
})
}

// return
return {
app,
themeManager,
Expand Down

1 comment on commit 5134a99

@vercel
Copy link

@vercel vercel bot commented on 5134a99 Jun 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.