Skip to content

Commit

Permalink
fix: do not access config.sanity on client
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Jun 25, 2024
1 parent 43d324e commit 23bf64c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/runtime/composables/visual-editing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,12 @@ export const useSanity = (client = 'default'): SanityHelper => {
nuxtApp._sanity = nuxtApp._sanity || {}

const $config = useRuntimeConfig()
const { additionalClients = {}, visualEditing, ...options } = defu(
$config.sanity,
$config.public.sanity,
)
const { additionalClients = {}, visualEditing, ...options } = import.meta.client
? $config.public.sanity
: defu(
$config.sanity,
$config.public.sanity,
)

if (client === 'default') {
nuxtApp._sanity.default = createSanityHelper({
Expand Down

0 comments on commit 23bf64c

Please sign in to comment.