sanity-io / sanity-template-nextjs-clean

A clean Next.js template with a native authoring experience
https://template-nextjs-clean.sanity.build
142 stars 57 forks source link

Update IFramePreviewView.tsx #14

Closed henrikfischer closed 1 year ago

henrikfischer commented 1 year ago

Vercel build is failing because of wrong use of client

vercel[bot] commented 1 year ago

@henrikfischer is attempting to deploy a commit to the Sanity Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
template-nextjs-clean ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 1, 2023 at 0:39AM (UTC)
snorrees commented 1 year ago

Hi, thanks for the PR!

What exactly is the build error in the original code? This component is unused, but provided there as an example (usage instructions in readme).

We recommend using useClient in studio components (which this is), because that accounts for studios with multiple workspaces, so providing the original error would be useful to investigate this further.

kevinorin commented 1 year ago

@henrikfischer updated file resolved the Vercel build error for me as well. Screen Shot 2023-03-02 at 8 51 32 PM

snorrees commented 1 year ago

I am unable to reproduce this, but realized that there where a couple of issues:

This is fixed on main now.

snorrees commented 1 year ago

I'm closing this PR, but feel free to reopen it if there is still a problem. If you do, please include the steps you took after running the template, as it would be really useful in reproducing the original issue.