From a549b46e90c9b31653fce10411bf5e19cf9f967e Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 24 May 2024 12:23:08 +0100 Subject: [PATCH] feat(nuxt): add `URL` serialiser for dev server logs --- packages/nuxt/src/app/plugins/dev-server-logs.ts | 1 + packages/nuxt/src/core/runtime/nitro/dev-server-logs.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/nuxt/src/app/plugins/dev-server-logs.ts b/packages/nuxt/src/app/plugins/dev-server-logs.ts index 587c9e75cc..eeae8d7562 100644 --- a/packages/nuxt/src/app/plugins/dev-server-logs.ts +++ b/packages/nuxt/src/app/plugins/dev-server-logs.ts @@ -12,6 +12,7 @@ const devRevivers: Record any> = import.meta.server ? {} : { VNode: data => h(data.type, data.props), + URL: data => new URL(data), } export default defineNuxtPlugin(async (nuxtApp) => { diff --git a/packages/nuxt/src/core/runtime/nitro/dev-server-logs.ts b/packages/nuxt/src/core/runtime/nitro/dev-server-logs.ts index 9a6f2369dc..3ff3f16676 100644 --- a/packages/nuxt/src/core/runtime/nitro/dev-server-logs.ts +++ b/packages/nuxt/src/core/runtime/nitro/dev-server-logs.ts @@ -14,6 +14,7 @@ import { rootDir } from '#internal/dev-server-logs-options' const devReducers: Record any> = { VNode: data => isVNode(data) ? { type: data.type, props: data.props } : undefined, + URL: data => data instanceof URL ? data.toString() : undefined, } interface NuxtDevAsyncContext {