Skip to content

Live preview is not working on deployed studio app #120

@davidmann4

Description

@davidmann4

Describe the bug

after following the instructions the live preview is not working on the deployed version. But it was working on localhost.

  • deployed nextjs app on vercel
  • deployed studio using npx sanity deploy
  • noticed preview url is localhost
  • set env vars on vercel app
  • created a .env.production file with SANITY_STUDIO_PROJECT_ID , SANITY_STUDIO_DATASET, SANITY_STUDIO_PREVIEW_URL, SANITY_STUDIO_STUDIO_HOST
  • redeployed studio app with npx sanity deploy
  • now was loading correct page but got an console error

console errors:

Uncaught Error: Minified React error #418; visit https://react.dev/errors/418?args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at rv (c7879cf7-ba6350d1eaa8a801.js:1:30573)
    at ol (c7879cf7-ba6350d1eaa8a801.js:1:75214)
    at uu (c7879cf7-ba6350d1eaa8a801.js:1:112193)
    at c7879cf7-ba6350d1eaa8a801.js:1:108292
    at c7879cf7-ba6350d1eaa8a801.js:1:108299
    at i8 (c7879cf7-ba6350d1eaa8a801.js:1:108396)
    at uD (c7879cf7-ba6350d1eaa8a801.js:1:129034)
    at MessagePort.T (239-a772b54b5f6f2a4d.js:1:123101)Understand this errorAI
hook.js:608 Unable to connect to visual editing. Make sure you've setup '@sanity/visual-editing' correctly
overrideMethod @ hook.js:608Understand this errorAI
 Third-party cookie is blocked in Chrome either because of Chrome flags or browser configuration.

To Reproduce

Steps to reproduce the behavior:

  1. follow steps in readme.md
  2. open sanity studio that was deployed

Expected behavior

live preivew should work

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