-
Notifications
You must be signed in to change notification settings - Fork 107
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Using next-sanity where the @sanity/client dependency is updated to version 7.0.0 (https://github.com/sanity-io/client/tree/v7.0.0), Typescript type errors appear.
To Reproduce
Steps to reproduce the behavior:
import { ClientConfig, createClient, QueryParams, defineLive } from 'next-sanity'
export const sanityClientConfig: ClientConfig = {
projectId: process.env.NEXT_PUBLIC_SANITY_PROJECT_ID,
dataset: process.env.NEXT_PUBLIC_SANITY_PROJECT_DATASET || 'production',
perspective: 'published'
}
export const sanityClient = createClient(sanityClientConfig)
export const { sanityFetch, SanityLive } = defineLive({
client: sanityClient,
browserToken: readToken,
serverToken: readToken,
})Typescript error:
web:typecheck: ../../packages/sanity/src/live.ts:12:3 - error TS2322: Type 'import("[REDACTED]/monorepo/node_modules/.pnpm/@[email protected]/node_modules/@sanity/client/dist/index").SanityClient' is not assignable to type 'import("[REDACTED]/monorepo/node_modules/.pnpm/@[email protected][email protected]/node_modules/@sanity/client/dist/index").SanityClient'.
web:typecheck: Property '#private' in type 'SanityClient' refers to a different member that cannot be accessed from within type 'SanityClient'.
web:typecheck:
web:typecheck: 12 client: sanityClient,
web:typecheck: ~~~~~~
web:typecheck:
web:typecheck: ../../node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]_react-d_09b4da6144152aa4728ba37f85ceda23/node_modules/@sanity/next-loader/dist/index.server-only.d.ts:146:3
web:typecheck: 146 client: SanityClient
web:typecheck: ~~~~~~
web:typecheck: The expected type comes from property 'client' which is declared here on type 'DefineSanityLiveOptions'
Expected behavior
No type errors.
Screenshots
Which versions of Sanity are you using?
@sanity/client version 7.0.0 (i.e. latest)
next-sanity version 9.10.2 (i.e. latest)
What operating system are you using?
macOS 15.4.1
Which versions of Node.js / npm are you running?
11.2.0
v22.14.0
Additional context
Turborepo monorepo.
mark-todd and n4bb12mikeploythai and frodeste
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working