-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.vue
More file actions
35 lines (33 loc) · 1007 Bytes
/
app.vue
File metadata and controls
35 lines (33 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<template>
<div class="min-h-screen">
<Alerts/>
<NuxtLayout>
<NuxtPage :key="key"/>
</NuxtLayout>
</div>
</template>
<script setup lang="ts">
document.head.classList.add('notranslate')
// TODO: Remove when https://github.com/vuejs/core/issues/5513 fixed
const key = ref(0);
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") {
// @ts-expect-error using arbitrary window key
if (!window.__vue5513) {
window.addEventListener("error", (event) => {
if (messages.includes(event.message)) {
event.preventDefault();
console.warn(
"Rerendering layout because of https://github.com/vuejs/core/issues/5513",
);
key.value++;
}
});
}
// @ts-expect-error using arbitrary window key
window.__vue5513 = true;
}
</script>