Next, Sanity, Vercel and Typescript templates - Preview functionality
Last updated: Jul 11, 2022
Thanks for a great tool, I'm enjoying exploring how it works. I'm stuck with one thing, though: the Next/Sanity/Vercel/Typescript starter appears to have the preview functionality set up, but it doesn't quite follow the different setup tutorials that I've seen elsewhere on the site and I can't get it working. The latest version is hitting a
For what it's worth, I tried this a few different ways and the latest attempt is giving me a
Not authenticated - preview not available
message. In Firefox, Safari, and Orion I don't get much more. Chrome gives the following trace. I saw an earlier similar message here, but without any responses...
Jul 10, 2022, 2:21 AM
, could you try enabling cross-site tracking in your web browser (and then sign out and back into the Studio)? We think it might be related to cookieless auth and this would confirm it…When cookieless auth is used, next-sanity won’t be able to access previews because the auth token is stored in localStorage instead of a cookie.
Jul 11, 2022, 1:06 PM
Well, check it! It works locally and on Vercel! Is this a known issue that I missed in the docs, then, or a temporary workaround? I appreciate the help and am happy to do whatever to make it more clear for people in the future.