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

createQueries prevent SolidStart SSR page from loading #7167

Closed
literalpie opened this issue Mar 24, 2024 · 2 comments
Closed

createQueries prevent SolidStart SSR page from loading #7167

literalpie opened this issue Mar 24, 2024 · 2 comments

Comments

@literalpie
Copy link

Describe the bug

In Safari the page fails to load, and in Chrome, the query never leaves a loading state when all of the following are true:

  • Solid Query version 5.0.0 or later is installed. (I don't see the issue in 5.0.0-beta.15, which is what makes me think this is a Tanstack issue, not SolidStart)
  • SSR is enabled using SolidStart
  • Any component in the page uses createQueries

Your minimal, reproducible example

https://github.com/literalpie/ben-solid-router

Steps to reproduce

Run the app (pnpm run dev) and open it in your browser. The main route will fail to load.

Notice that removing <CreateQueriesComponent /> from the App component allows the app to load.

Expected behavior

The route should load.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

macOS 14.4
Safari 17.4
@tanstack/solid-query 5.28.6
solid-js 1.8.16
@solidjs/start ^1.0.0-rc.0

Tanstack Query adapter

None

TanStack Query version

5.28.6

TypeScript version

No response

Additional context

No response

@ardeora
Copy link
Contributor

ardeora commented Apr 6, 2024

Yeah unfortunately createQueries primitive does not support SSR currently. But unlike useQueries you can implement a SSR supported structure by simply doing

const makeMultipleQueries = () => {
  return Array.from({ length: 100}).map((_, idx) => {
     return createQuery(() = ({...}))
  })
}

const queries = makeMultipleQueries()

@ardeora ardeora closed this as not planned Won't fix, can't repro, duplicate, stale Apr 13, 2024
@literalpie
Copy link
Author

Could this be documented or could we add a warning of some sort?

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

No branches or pull requests

2 participants