Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useLiveMode errors #71

Open
dvnrsn opened this issue May 30, 2024 · 0 comments
Open

useLiveMode errors #71

dvnrsn opened this issue May 30, 2024 · 0 comments

Comments

@dvnrsn
Copy link

dvnrsn commented May 30, 2024

This issue might belong elsewhere but I thought I'd ask.

I'm trying to invoke useLiveMode in a hydrogen (remix) project without success.

useLiveMode({client, studioUrl: 'http://localhost:3333'});

I believe this hook is critical for VisualEditing to work. But when I invoke useLiveMode I am consistently failing at this line

// @sanity/react-loader/src/defineUseLiveMode.ts
(client as SanityClient)?.config().stega.studioUrl

// config is not a function

I am fairly certain I have the correct sanity client and I am even trying to provide studioUrl so it short circuits the nullish coalescing operator but it is still breaking.

setStudioUrl(
  studioUrl ?? typeof client === 'object'
    ? (client as SanityClient)?.config().stega.studioUrl
    : undefined,

Is it necessary to have this hook? Is there a way I may be able to get it to work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant