2023-02-16 12:43:58 +00:00
|
|
|
<script setup lang="ts">
|
|
|
|
definePageMeta({
|
2023-04-10 21:57:13 +00:00
|
|
|
async middleware (to, from) {
|
|
|
|
await new Promise(resolve => setTimeout(resolve, 1))
|
2023-02-16 12:43:58 +00:00
|
|
|
const nuxtApp = useNuxtApp()
|
2023-08-07 22:03:40 +00:00
|
|
|
if (import.meta.client && from !== to && !nuxtApp.isHydrating) {
|
2023-02-16 12:43:58 +00:00
|
|
|
// trigger a loading error when navigated to via client-side navigation
|
|
|
|
await import(/* webpackIgnore: true */ /* @vite-ignore */ `some-non-exis${''}ting-module`)
|
|
|
|
}
|
2024-04-05 18:08:32 +00:00
|
|
|
},
|
2023-02-16 12:43:58 +00:00
|
|
|
})
|
2023-03-08 12:17:22 +00:00
|
|
|
const someValue = useState('val', () => 1)
|
2023-02-16 12:43:58 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
Chunk error page
|
2023-03-08 12:17:22 +00:00
|
|
|
<hr>
|
|
|
|
State: {{ someValue }}
|
2023-02-16 12:43:58 +00:00
|
|
|
</div>
|
|
|
|
</template>
|