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

[vike-solid-query] No QueryClient set, use QueryClientProvider to set one #123

Closed
rtritto opened this issue Sep 16, 2024 · 1 comment · Fixed by #127
Closed

[vike-solid-query] No QueryClient set, use QueryClientProvider to set one #123

rtritto opened this issue Sep 16, 2024 · 1 comment · Fixed by #127

Comments

@rtritto
Copy link
Contributor

rtritto commented Sep 16, 2024

Created home page from examples/solid-query.

Reproduction

  1. git clone https://github.com/rtritto/template-vike-elysia-solid-daisyui.git
  2. cd template-vike-elysia-solid-daisyui
  3. git test-solid-query
  4. yarn
  5. yarn dev
  6. Navigate to http://localhost:3000

Output

  VITE v5.4.5  ready in 1052 ms
  ➜  Local:   http://localhost:3000/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
8:11:36 PM [vike][request(1)] HTTP request: /

🌼   daisyUI 4.12.10
├─ ✔︎ 1 theme added             https://daisyui.com/docs/themes
╰─ ❤︎ Support daisyUI project:  https://opencollective.com/daisyui

8:11:37 PM [vike][request(1)] Following error was thrown by the onRenderHtml() hook defined at vike-solid/__internal/integration/onRenderHtml
15 |   if (queryClient) {
16 |     return queryClient;
17 |   }
18 |   const client = useContext(QueryClientContext);
19 |   if (!client) {
20 |     throw new Error("No QueryClient set, use QueryClientProvider to set one");
              ^
error: No QueryClient set, use QueryClientProvider to set one
      at useQueryClient (C:\template-vike-elysia-solid-daisyui\node_modules\@tanstack\solid-query\build\dev.js:20:10)
      at createMemo (C:\template-vike-elysia-solid-daisyui\node_modules\solid-js\dist\server.js:97:10)
      at createBaseQuery (C:\template-vike-elysia-solid-daisyui\node_modules\@tanstack\solid-query\build\dev.js:194:11)
      at Movies (unknown:25:50)
      at createComponent (C:\template-vike-elysia-solid-daisyui\node_modules\solid-js\dist\server.js:359:10)
      at Page (unknown:17:322)
      at createComponent (C:\template-vike-elysia-solid-daisyui\node_modules\solid-js\dist\server.js:359:10)
      at createComponent (C:\template-vike-elysia-solid-daisyui\node_modules\solid-js\dist\server.js:359:10)
      at renderWrappers (C:\template-vike-elysia-solid-daisyui\node_modules\vike-solid\dist\integration\onRenderHtml.js:72:4)
      at children (unknown:32:19)
      at Content (unknown:20:173)
      at createComponent (C:\template-vike-elysia-solid-daisyui\node_modules\solid-js\dist\server.js:359:10)
      at Layout (unknown:30:74)
      at createComponent (C:\template-vike-elysia-solid-daisyui\node_modules\solid-js\dist\server.js:359:10)
      at createComponent (C:\template-vike-elysia-solid-daisyui\node_modules\solid-js\dist\server.js:359:10)
      at children (C:\template-vike-elysia-solid-daisyui\node_modules\vike-solid\dist\hooks\usePageContext.js:12:7)

8:11:37 PM [vike][request(1)] HTTP response / 500

Notes

@phonzammi
Copy link
Member

@rtritto, Thanks for opening this issue.

I can reproduce the issue, and it appears to happen only in development, not in the build. I need to investigate further. Feel free to create a PR to help address this issue.

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

Successfully merging a pull request may close this issue.

2 participants