Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type error: 'LiveQuery' cannot be used as a JSX component #767

Open
anthowm opened this issue Dec 13, 2023 · 1 comment
Open

Type error: 'LiveQuery' cannot be used as a JSX component #767

anthowm opened this issue Dec 13, 2023 · 1 comment
Labels

Comments

@anthowm
Copy link

anthowm commented Dec 13, 2023

Describe the bug

When deploy our project to Vercel I get the following error


Type error: 'LiveQuery' cannot be used as a JSX component.
--
17:36:59.112 | xxxx:build:   Its return type 'ReactNode' is not a valid JSX element.
17:36:59.112 | xxxx:build:     Type 'undefined' is not assignable to type 'Element \| null'.

To Reproduce

<LiveQuery enabled={draftMode().isEnabled} initialData={data} query={pageComponentsQuery}>
        <div>...</div>
</LiveQuery>

Expected behavior

To build in production issue is coming from this type

declare function LiveQuery<
  QueryResult,
  QueryParams extends QueryParams = QueryParams
>(props: LiveQueryProps<QueryResult, QueryParams>): ReactNode

Screenshots
Uploading image.png…

Which versions of Sanity are you using?

@sanity/cli (global)                   3.20.1 (latest: 3.21.3)
@sanity/color-input                     3.1.0 (up to date)
@sanity/document-internationalization   2.0.2 (up to date)
@sanity/image-url                       1.0.2 (up to date)
@sanity/preview-kit                     3.2.7 (latest: 5.0.6) ---> this one is 5.0.0 because is coming from sanity/client 6.4.12
@sanity/scheduled-publishing            1.2.2 (up to date)
@sanity/vision                         3.20.1 (latest: 3.21.3)
@sanity/webhook                         4.0.0 (up to date)
sanity                                 3.19.2 (latest: 3.21.3)

What operating system are you using?

Mac

Which versions of Node.js / npm are you running?

10.2.0
v21.1.0

@stipsan stipsan added the triaged label Jan 2, 2024
@stipsan
Copy link
Member

stipsan commented Mar 7, 2024

Could you try https://www.npmjs.com/package/@sanity/preview-kit/v/5.0.31 and see if it solves it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants