
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeI can see you're hitting a redirect issue with the Remix live preview guide! The good news is that the guide you're following has actually been updated since it was first published, and the resource.preview.tsx route approach is no longer the recommended pattern.
Looking at the official guide you linked, the modern implementation uses the Presentation Tool with Visual Editing, which works completely differently and doesn't require a resource.preview.tsx route at all.
The current guide shows that live preview now works through:
@sanity/react-loader - Handles loading data with live updates@sanity/visual-editing - Provides the clickable overlays and communication with PresentationThe magic happens when your Remix app is loaded inside the Presentation Tool's iframe. The LiveVisualEditing component (which imports VisualEditing from @sanity/visual-editing/remix) handles all the communication between the Studio and your app automatically.
If you're following an older version of the guide or mixing old and new patterns, you might be creating a resource.preview.tsx file that's trying to set session cookies. But the modern approach doesn't use sessions at all - it uses "stega" (Content Source Maps) encoded directly in the data.
1. Verify your setup matches the current guide:
SANITY_STUDIO_STEGA_ENABLED="true" in your .envuseQuery from @sanity/react-loaderLiveVisualEditing component in your root route2. Remove any resource.preview.tsx file - you don't need it with the modern approach
3. Make sure you're viewing through Presentation:
http://localhost:3333/presentationhttp://localhost:3000 inside an iframe4. Check your CORS settings in sanity.io/manage - you need http://localhost:3000 added with "Allow credentials" checked
SANITY_STUDIO_STEGA_ENABLED is actually "true" (as a string)LiveVisualEditing component is rendering (it should only render when SANITY_STUDIO_STEGA_ENABLED is true)useQuery hook in your routes, not just the raw data from the loaderIf you want to start with a working example, the official Remix + Sanity clean template implements all these patterns correctly and might help you spot what's different in your setup.
The key insight: modern Remix + Sanity live preview doesn't use resource routes or session cookies - it uses stega-encoded data and the Visual Editing component to enable real-time updates when viewed through the Presentation Tool!
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store