diff --git a/packages/nuxt/src/app/nuxt.ts b/packages/nuxt/src/app/nuxt.ts index db062b6b58..d8fd5ffb5a 100644 --- a/packages/nuxt/src/app/nuxt.ts +++ b/packages/nuxt/src/app/nuxt.ts @@ -563,8 +563,8 @@ function wrappedConfig (runtimeConfig: Record) { const keys = Object.keys(runtimeConfig).map(key => `\`${key}\``) const lastKey = keys.pop() return new Proxy(runtimeConfig, { - get (target, p: string, receiver) { - if (p !== 'public' && !(p in target) && !p.startsWith('__v') /* vue check for reactivity, e.g. `__v_isRef` */) { + get (target, p, receiver) { + if (typeof p === 'string' && p !== 'public' && !(p in target) && !p.startsWith('__v') /* vue check for reactivity, e.g. `__v_isRef` */) { console.warn(`[nuxt] Could not access \`${p}\`. The only available runtime config keys on the client side are ${keys.join(', ')} and ${lastKey}. See \`https://nuxt.com/docs/guide/going-further/runtime-config\` for more information.`) } return Reflect.get(target, p, receiver)