From 93801def67d29fd19c914136bb15da630f3a4c46 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 7 Aug 2024 13:51:13 +0100 Subject: [PATCH] fix(nuxt): ensure `runtimeConfig.public` is reactive on client (#28443) --- packages/nuxt/src/app/composables/payload.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/nuxt/src/app/composables/payload.ts b/packages/nuxt/src/app/composables/payload.ts index 69cd0919db..558a50886a 100644 --- a/packages/nuxt/src/app/composables/payload.ts +++ b/packages/nuxt/src/app/composables/payload.ts @@ -1,7 +1,7 @@ import { hasProtocol, joinURL, withoutTrailingSlash } from 'ufo' import { parse } from 'devalue' import { useHead } from '@unhead/vue' -import { getCurrentInstance, onServerPrefetch } from 'vue' +import { getCurrentInstance, onServerPrefetch, reactive } from 'vue' import { useNuxtApp, useRuntimeConfig } from '../nuxt' import type { NuxtPayload } from '../nuxt' @@ -122,6 +122,10 @@ export async function getNuxtClientPayload () { ...window.__NUXT__, } + if (payloadCache!.config?.public) { + payloadCache!.config.public = reactive(payloadCache!.config.public) + } + return payloadCache }