Skip to content

Typescript issue with the <LiveMode /> SvelteKit implementation #3038

@flayks

Description

@flayks

Describe the bug

Following the latest up to date (May 15th) guide using svelte-loader to enable live mode on my SvelteKit site, I get this typescript error using the latest SvelteKit, Sanity and svelte-loader:

{#if pageData.preview}
    <VisualEditing />
    <LiveMode {client} />
{/if}

Type 'import("/Users/flayks/sites/project/node_modules/@sanity/client/dist/index").SanityClient' is not assignable to type 'import("/Users/flayks/sites/project/node_modules/@sanity/core-loader/node_modules/@sanity/client/dist/index").SanityClient'.
Property '#private' in type 'SanityClient' refers to a different member that cannot be accessed from within type 'SanityClient'.ts(2322)

To Reproduce

Follow the guide on https://www.sanity.io/docs/visual-editing/visual-editing-with-sveltekit#k67b610cece20 for the live mode

Expected behavior

No type issue

Which versions of Sanity are you using?

@sanity/cli (global)     3.92.0 (up to date)
@sanity/image-url         1.1.0 (up to date)
@sanity/svelte-loader   1.13.41 (up to date)
@sanity/visual-editing   2.15.0 (up to date)

Which versions of Node.js / npm are you running?

11.4.1
v22.16.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions