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] Error: No QueryClient set, use QueryClientProvider to set one #140

Open
rtritto opened this issue Dec 9, 2024 · 8 comments
Labels
bug 💥 Something isn't working

Comments

@rtritto
Copy link
Contributor

rtritto commented Dec 9, 2024

Description

After adding root: 'src' in vite.config.ts, I get Error: No QueryClient set, use QueryClientProvider to set one.

Repro (repo: template-vike-solid-daisyui-hono ~ branch: issue-vike-2012)

  • git clone https://github.com/templates-ecosystem/template-vike-solid-daisyui-hono.git
  • git checkout issue-vike-2012
  • cd template-vike-solid-daisyui-hono
  • yarn
  • yarn dev
  • go to http://localhost:3000
  VITE v5.4.11  ready in 1746 ms
  ➜  Local:   http://localhost:3000/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
09:57:16 [vike][request(1)] HTTP request: /
09:57:16 [vike][request(1)] Following error was thrown by the onRenderHtml() hook defined at vike-solid/__internal/integration/onRenderHtml
Error: No QueryClient set, use QueryClientProvider to set one
    at useQueryClient (file:///C:/template-vike-solid-daisyui-hono/.yarn/__virtual__/@tanstack-solid-query-virtual-b5bcec7192/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/@tanstack-solid-query-npm-5.62.3-b39f0155c2-10c0.zip/node_modules/@tanstack/solid-query/build/dev.js:20:11)
    at file:///C:/template-vike-solid-daisyui-hono/.yarn/__virtual__/@tanstack-solid-query-virtual-b5bcec7192/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/@tanstack-solid-query-npm-5.62.3-b39f0155c2-10c0.zip/node_modules/@tanstack/solid-query/build/dev.js:101:35
    at createMemo (file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/dist/server.js:95:9)
    at createBaseQuery (file:///C:/template-vike-solid-daisyui-hono/.yarn/__virtual__/@tanstack-solid-query-virtual-b5bcec7192/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/@tanstack-solid-query-npm-5.62.3-b39f0155c2-10c0.zip/node_modules/@tanstack/solid-query/build/dev.js:101:18)
    at Module.createQuery (file:///C:/template-vike-solid-daisyui-hono/.yarn/__virtual__/@tanstack-solid-query-virtual-b5bcec7192/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/@tanstack-solid-query-npm-5.62.3-b39f0155c2-10c0.zip/node_modules/@tanstack/solid-query/build/dev.js:309:10)
    at Page (C:\template-vike-solid-daisyui-hono\src\pages\index\+Page.tsx:14:17)
    at Dynamic (file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/web/dist/server.js:1148:34)
    at createComponent (file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/dist/server.js:367:15)
    at Page (file:///C:/template-vike-solid-daisyui-hono/.yarn/__virtual__/vike-solid-virtual-4d7f7193b4/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vike-solid-npm-0.7.6-78378fb319-10c0.zip/node_modules/vike-solid/dist/integration/onRenderHtml.js:68:10)
    at createComponent (file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/dist/server.js:367:15)
    at Object.get children [as children] (file:///C:/template-vike-solid-daisyui-hono/.yarn/__virtual__/vike-solid-virtual-4d7f7193b4/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vike-solid-npm-0.7.6-78378fb319-10c0.zip/node_modules/vike-solid/dist/integration/onRenderHtml.js:37:18)
    at renderWrappers (file:///C:/template-vike-solid-daisyui-hono/.yarn/__virtual__/vike-solid-virtual-4d7f7193b4/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vike-solid-npm-0.7.6-78378fb319-10c0.zip/node_modules/vike-solid/dist/integration/onRenderHtml.js:56:29)
    at Object.get children [as children] (file:///C:/template-vike-solid-daisyui-hono/.yarn/__virtual__/vike-solid-virtual-4d7f7193b4/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vike-solid-npm-0.7.6-78378fb319-10c0.zip/node_modules/vike-solid/dist/integration/onRenderHtml.js:60:16)
    at Object.get children [as children] (file:///C:/template-vike-solid-daisyui-hono/.yarn/__virtual__/vike-solid-query-virtual-6736f12fe1/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vike-solid-query-npm-0.1.0-f4024291fa-10c0.zip/node_modules/vike-solid-query/dist/integration/Wrapper.js:11:20)
    at Object.get children [as children] (file:///C:/template-vike-solid-daisyui-hono/.yarn/__virtual__/@tanstack-solid-query-virtual-b5bcec7192/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/@tanstack-solid-query-npm-5.62.3-b39f0155c2-10c0.zip/node_modules/@tanstack/solid-query/build/index.js:34:20)
    at file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/dist/server.js:216:35
    at file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/dist/server.js:179:49
    at createMemo (file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/dist/server.js:95:9)
    at children (file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/dist/server.js:179:16)
    at file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/dist/server.js:216:14
    at createMemo (file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/dist/server.js:95:9)
    at provider (file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/dist/server.js:211:12)
    at createComponent (file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/dist/server.js:367:15)
    at QueryClientProvider (file:///C:/template-vike-solid-daisyui-hono/.yarn/__virtual__/@tanstack-solid-query-virtual-b5bcec7192/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/@tanstack-solid-query-npm-5.62.3-b39f0155c2-10c0.zip/node_modules/@tanstack/solid-query/build/index.js:31:10)
    at createComponent (file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/dist/server.js:367:15)
    at Wrapper (file:///C:/template-vike-solid-daisyui-hono/.yarn/__virtual__/vike-solid-query-virtual-6736f12fe1/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vike-solid-query-npm-0.1.0-f4024291fa-10c0.zip/node_modules/vike-solid-query/dist/integration/Wrapper.js:8:10)
    at createComponent (file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/dist/server.js:367:15)
    at renderWrappers (file:///C:/template-vike-solid-daisyui-hono/.yarn/__virtual__/vike-solid-virtual-4d7f7193b4/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vike-solid-npm-0.7.6-78378fb319-10c0.zip/node_modules/vike-solid/dist/integration/onRenderHtml.js:58:12)
    at Wrapper (file:///C:/template-vike-solid-daisyui-hono/.yarn/__virtual__/vike-solid-virtual-4d7f7193b4/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vike-solid-npm-0.7.6-78378fb319-10c0.zip/node_modules/vike-solid/dist/integration/onRenderHtml.js:64:10)
    at createComponent (file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/dist/server.js:367:15)
    at Object.get children [as children] (file:///C:/template-vike-solid-daisyui-hono/.yarn/__virtual__/vike-solid-virtual-4d7f7193b4/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vike-solid-npm-0.7.6-78378fb319-10c0.zip/node_modules/vike-solid/dist/integration/onRenderHtml.js:35:14)
    at Object.get children [as children] (file:///C:/template-vike-solid-daisyui-hono/.yarn/__virtual__/vike-solid-virtual-4d7f7193b4/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vike-solid-npm-0.7.6-78378fb319-10c0.zip/node_modules/vike-solid/dist/hooks/usePageContext.js:26:20)
    at file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/dist/server.js:216:35
    at file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/dist/server.js:179:49
    at createMemo (file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/dist/server.js:95:9)
    at children (file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/dist/server.js:179:16)
    at file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/dist/server.js:216:14
    at createMemo (file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/dist/server.js:95:9)
    at provider (file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/dist/server.js:211:12)
    at createComponent (file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/dist/server.js:367:15)
    at PageContextProvider (file:///C:/template-vike-solid-daisyui-hono/.yarn/__virtual__/vike-solid-virtual-4d7f7193b4/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vike-solid-npm-0.7.6-78378fb319-10c0.zip/node_modules/vike-solid/dist/hooks/usePageContext.js:21:10)
    at createComponent (file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/dist/server.js:367:15)
    at getPageElement (file:///C:/template-vike-solid-daisyui-hono/.yarn/__virtual__/vike-solid-virtual-4d7f7193b4/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vike-solid-npm-0.7.6-78378fb319-10c0.zip/node_modules/vike-solid/dist/integration/onRenderHtml.js:32:16)
    at file:///C:/template-vike-solid-daisyui-hono/.yarn/__virtual__/vike-solid-virtual-4d7f7193b4/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vike-solid-npm-0.7.6-78378fb319-10c0.zip/node_modules/vike-solid/dist/integration/onRenderHtml.js:120:61
    at file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/web/dist/server.js:559:34
    at createRoot (file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/dist/server.js:58:14)
    at renderToString (file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/solid-js-npm-1.9.3-16b4808c18-10c0.zip/node_modules/solid-js/web/dist/server.js:557:14)
    at getPageHtml (file:///C:/template-vike-solid-daisyui-hono/.yarn/__virtual__/vike-solid-virtual-4d7f7193b4/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vike-solid-npm-0.7.6-78378fb319-10c0.zip/node_modules/vike-solid/dist/integration/onRenderHtml.js:120:40)
    at onRenderHtml (file:///C:/template-vike-solid-daisyui-hono/.yarn/__virtual__/vike-solid-virtual-4d7f7193b4/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vike-solid-npm-0.7.6-78378fb319-10c0.zip/node_modules/vike-solid/dist/integration/onRenderHtml.js:89:26)
    at file:///C:/template-vike-solid-daisyui-hono/.yarn/__virtual__/vike-virtual-3abe11c81b/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vike-npm-0.4.206-5dcbd8efc2-10c0.zip/node_modules/vike/dist/esm/node/runtime/renderPage/executeOnRenderHtmlHook.js:16:53
09:57:17 [vike][request(1)] HTTP response / 500
@rtritto rtritto added the bug 💥 Something isn't working label Dec 9, 2024
@brillout brillout transferred this issue from vikejs/vike Dec 9, 2024
@magne4000
Copy link
Member

@phonzammi any ideas?

@phonzammi
Copy link
Member

I don't see any error.

Screen.Recording.2024-12-10.at.13.22.46.mov

@rtritto
Copy link
Contributor Author

rtritto commented Dec 10, 2024

I don't see any error.
Screen.Recording.2024-12-10.at.13.22.46.mov

Seems to be a Windows issue

@magne4000
Copy link
Member

I currently do not have a working Windows setup to try this out, nor consider this high priority bug to fix.
@rtritto If you have some ideas on how to fix it, a PR would be highly appreciated.

@rtritto
Copy link
Contributor Author

rtritto commented Dec 16, 2024

Can I do something to help?
The error is generated by @tanstack/solid-query/build/dev.js, I can debug to provide some context.

@magne4000
Copy link
Member

I do not have much more knowledge than you around this issue I think.
If you manage to debug it to pinpoint the issue, we can then find a way to fix it

@brillout
Copy link
Member

CC @Blankeos in case you didn't see this already.

@rtritto
Copy link
Contributor Author

rtritto commented Dec 19, 2024

const root = process.cwd();
const config: UserConfig = {
root,
plugins: [vpvs()],
server: {
port: process.env.PORT ? parseInt(process.env.PORT) : undefined,
},
};

Should root option consider the user config in ./vite.config.js? Something like const root = userViteConfig.root || process.cwd() or (preferred) vite.mergeConfig.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 💥 Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants