mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 15:15:19 +00:00
fix(nuxt): handle symbol keys in wrapped runtime config
This commit is contained in:
parent
9655ce6f62
commit
13fec55c10
@ -563,8 +563,8 @@ function wrappedConfig (runtimeConfig: Record<string, unknown>) {
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user