vikejs / vike-react

🔨 React integration for Vike
https://vike.dev/vike-react
MIT License
94 stars 15 forks source link

vike-react-query throws error in `onRenderHtml` #129

Closed jordyalcides closed 1 month ago

jordyalcides commented 1 month ago

Description

Describe the bug

Starting a new project using vike-react-query throws an error after the first page request

To Reproduce

Steps to reproduce the behavior, run the following commands in order:

pnpm create @batijs/app --react --tailwindcss --hono --cloudflare --prettier

than pnpm add @tanstack/react-query vike-react-query

than change the pages/+config.ts to include vike-react-query plugin on extends prop

export default {
    Head,
    title: 'My Vike App',
    extends: [vikeReact, vikeReactQuery],
    passToClient: ['routeParams'],
} satisfies Config

setup everything as the docs mention

Expected behavior

Run dev mode without any errors

Screenshots Screenshot 2024-07-09 at 17 52 40

Additional context Using macOS Ventura 13.6.6 and the following related libs:

"react": "^18.3.1",
"@hono/node-server": "^1.12.0",
"hono": "^4.4.11",
"@vitejs/plugin-react": "^4.3.1",
"vike": "^0.4.178",
"vike-cloudflare": "^0.0.4",
"vike-react": "^0.4.16",
"vike-react-query": "^0.1.0",
"vite": "^5.3.3",
brillout commented 1 month ago

Can you publish a reproduction?

brillout commented 1 month ago

How did you resolve your #1729 issue btw.?

jordyalcides commented 1 month ago

Can you publish a reproduction?

I could reproduce it on stackblitz using this run command:

pnpm create @batijs/app --react --tailwindcss --hono --cloudflare --prettier

than pnpm add @tanstack/react-query vike-react-query

than change the pages/+config.ts to include vike-react-query plugin on extends prop

export default {
    Head,
    title: 'My Vike App',
    extends: [vikeReact, vikeReactQuery],
    passToClient: ['routeParams'],
} satisfies Config
brillout commented 1 month ago

Make sure to set the stream setting to web.

Closing in favor of https://github.com/batijs/bati/discussions/303.