sanity-io / hydrogen-sanity

A Sanity toolkit for Hydrogen
MIT License
46 stars 7 forks source link

v4 preview issues #75

Open dvnrsn opened 1 month ago

dvnrsn commented 1 month ago
Unable to connect to overlays. 
Make sure you're calling the 'enableOverlays' function in '@sanity/overlays' correctly
previewUrl: {previewMode: {enable: '/resource/preview'}},
CleanShot 2024-05-22 at 11 36 22@2x

This begins to work if I use

    presentationTool({
      previewUrl: 'http://localhost:3000',
    }),

~But then I get no matching documents even though I have content displaying fine~ edit: this seems to work

CleanShot 2024-05-22 at 11 39 20@2x
dvnrsn commented 1 month ago

Maybe it should be

    presentationTool({
      previewUrl: process.env.SANITY_STUDIO_PREVIEW_URL || 'http://localhost:3000',

like sanity-template-remix-clean

dvnrsn commented 1 month ago

I believe the origin is needed here so something like


previewUrl: {
  origin: process.env.SANITY_STUDIO_PREVIEW_URL || 'https://sharonmcmahon.com',
  previewMode: {enable: '/resource/preview'},
},