[nuxt] Could not access sanity
. The only available runtime config keys on the client side are public
and app
.
#1059
Labels
question
Further information is requested
Hi there – apologies in advance, as I don’t think this is a high-quality question, but can’t find anything addressing it through the docs or issues here. I’m hoping its a relatively straightforward misunderstanding that I’m building with?
I’m seeing this warning wherever I call useSanity in my Nuxt 1.13.1 app. It’s also followed me through every version of Nuxt 3 I’ve had installed from 3.0.0 all the way up.
I’d like to try and resolve it, as I think it might be tied up with hydration issues I’m experiencing with aspects it affects further down the chain. The strange thing is, if I console.log the config returned by useSanity, it’s correct and exactly as I’d expect.
I’ve seen the warning referenced in other open issues e.g. #920, and while the url builder is one such area I get this warning, I’ve since managed to avoid it by calling useSanity outside of a plugin.
So here are two areas I know the warning arises:
– useSanity called within a plugin
– useSanityQuery called within a pinia store, e.g. stores/MainStore.js
The following starter could be used as a good indication of my setup, I will only have found ways to make Julian’s brilliant work dramatically worse :-)
https://github.com/jjjuulliiaann/sanity-nuxt-3-starter
The text was updated successfully, but these errors were encountered: