-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Bug: pageContext.queryClient isn't defined on the client-side #163
Comments
Are you using the latest version of all dependencies? Can you publish the reproduction on GitHub? |
Yes, I have upgraded to the latest version, this is repo on Github https://github.com/flyerH/vike-vue-example |
And I found this modify can fix problem, but I don't know if it will cause new problem. // https://github.com/vikejs/vike-vue/blob/main/packages/vike-vue-query/renderer/hydrateVueQuery.ts
- const hydrateVueQuery = ({ queryClient, fromHtmlRenderer, isHydration }) => {
+ const hydrateVueQuery = (params) => {
+ const { fromHtmlRenderer, isHydration } = params;
+ const queryClient = 'queryClient' in params ? params.queryClient : null;
if (!isHydration) {
return;
}
const { vueQueryInitialState } = fromHtmlRenderer;
if (!queryClient || !vueQueryInitialState) {
// happens if SSR is off
return;
}
hydrate(queryClient, vueQueryInitialState);
}; |
I went for your fix and pre-released it as Let's see if you still have issues. (Btw. in case your company is up for it we're looking for sponsors.) |
The problem is solved, thanks~ |
Hello, can you please publish a release version of vike-vue-query? |
Released |
This is a mini repo
https://stackblitz.com/edit/vitejs-vite-sysrfj?file=package.json
The text was updated successfully, but these errors were encountered: