Skip to content

Commit d336834

Browse files
committed
chore: update dependencies and optimize error handling
1 parent 701b77c commit d336834

File tree

4 files changed

+262
-134
lines changed

4 files changed

+262
-134
lines changed

app/error.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
</template>
1515

1616
<script lang="ts" setup>
17+
import { destr } from 'destr'
1718
import type { NuxtError } from '#app'
1819
1920
useServerHead({
@@ -25,7 +26,7 @@ const { error } = defineProps<{ error: NuxtError<any> }>()
2526
const { statusCode, statusMessage, message, data } = toRefs(
2627
reactive({
2728
...error,
28-
data: typeof error.data === 'string' ? JSON.parse(error.data) : error.data
29+
data: destr<any>(error.data)
2930
})
3031
)
3132
</script>

nuxt.config.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,13 @@ export default defineNuxtConfig({
4040
'@vueuse/nuxt',
4141
'nuxt-security',
4242
'@nuxtjs/device',
43+
'@nuxt/image',
44+
'@nuxt/icon',
4345
'@sunshj/mdc',
46+
'@nuxtjs/mdc',
4447
'@nuxtjs/color-mode'
4548
],
4649

47-
icon: {
48-
clientBundle: {
49-
scan: true
50-
}
51-
},
52-
5350
colorMode: {
5451
classSuffix: '',
5552
storage: 'cookie'

package.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@
1919
"format": "prettier . --write"
2020
},
2121
"dependencies": {
22+
"@nuxt/icon": "1.8.2",
23+
"@nuxt/image": "1.8.1",
2224
"@nuxtjs/color-mode": "^3.5.2",
2325
"@nuxtjs/device": "^3.2.4",
26+
"@nuxtjs/mdc": "0.9.2",
2427
"@prisma/client": "5.21.1",
25-
"@sunshj/mdc": "^0.2.2",
28+
"@sunshj/mdc": "^0.3.1",
2629
"@vueuse/core": "^11.2.0",
2730
"element-plus": "^2.8.6",
2831
"nuxt": "^3.13.2",
@@ -52,6 +55,9 @@
5255
"unplugin-vue-router": "^0.10.8",
5356
"vue-tsc": "^2.1.10"
5457
},
58+
"overrides": {
59+
"nitropack": "2.9.7"
60+
},
5561
"pnpm": {
5662
"patchedDependencies": {
5763

0 commit comments

Comments
 (0)