Issue with LiveQueryProvider in Next.js 14.0.4 and next-sanity@7.0.3 causing an error.

2 replies
Last updated: Dec 12, 2023
Hi folks, I have an issue with the
LiveQueryProvider
in latest Next.js 14.0.4 with
next-sanity@7.0.3
. If I comment out the Provider everything works fine but with the Provider enabled I get the following error message

Error: Element type is invalid. Received a promise that resolves to: [object Object]. Lazy element type must resolve to a class or function. Did you wrap a component in React.lazy() more than once?
Does anyone else have the same issue?
Dec 12, 2023, 9:32 AM
Got it,
@sanity/preview-kit
already wraps the
LiveQueryProvider
in a lazy import. So importing the component without
dynamic
works.
Dec 12, 2023, 9:36 AM
Thanks πŸ™
Dec 12, 2023, 12:39 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?