Closed stipsan closed 2 weeks ago
The latest updates on your projects. Learn more about Vercel for Git โ๏ธ
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
live-visual-editing-next | โ Ready (Inspect) | Visit Preview | ๐ฌ Add feedback | Nov 6, 2024 5:04pm |
visual-editing-astro | โ Ready (Inspect) | Visit Preview | ๐ฌ Add feedback | Nov 6, 2024 5:04pm |
visual-editing-next | โ Ready (Inspect) | Visit Preview | ๐ฌ Add feedback | Nov 6, 2024 5:04pm |
visual-editing-next-with-i18n | โ Ready (Inspect) | Visit Preview | ๐ฌ Add feedback | Nov 6, 2024 5:04pm |
visual-editing-nuxt | โ Ready (Inspect) | Visit Preview | ๐ฌ Add feedback | Nov 6, 2024 5:04pm |
visual-editing-page-builder-demo | โ Failed (Inspect) | Nov 6, 2024 5:04pm | ||
visual-editing-remix | โ Ready (Inspect) | Visit Preview | ๐ฌ Add feedback | Nov 6, 2024 5:04pm |
visual-editing-storybook | โ Ready (Inspect) | Visit Preview | ๐ฌ Add feedback | Nov 6, 2024 5:04pm |
visual-editing-studio | โ Ready (Inspect) | Visit Preview | ๐ฌ Add feedback | Nov 6, 2024 5:04pm |
visual-editing-svelte | โ Ready (Inspect) | Visit Preview | ๐ฌ Add feedback | Nov 6, 2024 5:04pm |
New and removed dependencies detected. Learn more about Socket for GitHub โ๏ธ
Package | New capabilities | Transitives | Size | Publisher |
---|---|---|---|---|
npm/react-dom@19.0.0-rc-66855b96-20241106 | Transitive: environment | +1 |
6.44 MB | fb, gnoff, react-bot, ...2 more |
npm/react@19.0.0-rc-66855b96-20241106 | None | 0 |
238 kB | fb, gnoff, react-bot, ...1 more |
npm/sonner@1.7.0 | None | 0 |
247 kB | emilkowalski |
๐ฎ Removed packages: npm/react-dom@19.0.0-rc-33c7bd9a-20241104, npm/react@19.0.0-rc-33c7bd9a-20241104
By default errors will be logged to the console, instead of thrown during render. With special handling for CORS origin errors (reported using
console.warn
):The
onError
prop on<SanityLive />
, and the newisCorsOriginError
utility, can be used to customise this behaviour. Since theonError
prop is eventually called by a client component, it's important that the function you give it comes from a file that has'use client'
at the top.In other words this wouldn't work:
This would work (and is what the default Next.js error message for passing a regular function might lead you to do), but is not recommended, as it would needlessly run a POST request to the server, calling your
handleError
which is now an inline Server Action:It's also wrong to add
use client
to thelayout.tsx
itself, as<SanityLive />
is a react server component, that renders<SanityLiveClientComponent />
internally, a client component. Thus client components are not allowed to use this and you'll get an error:The right approach is to create a separate file, for example
client-utils.ts
, here showing how to usesonner
to show toasts when an error happens:In your layout.tsx you can then pass it as a regular prop without issue:
The end result is a nice toast:
Which takes you to Sanity Manage, much the same way Sanity Studio does when CORS errors happen there: