Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

vike error with stream enabled #30

Closed
YKDZ opened this issue Dec 10, 2024 · 1 comment
Closed

vike error with stream enabled #30

YKDZ opened this issue Dec 10, 2024 · 1 comment

Comments

@YKDZ
Copy link

YKDZ commented Dec 10, 2024

When updating vike-node from 0.1.16 to 0.2.6, I encountered this error:

Error: [vike][Wrong Usage] pageContext.httpResponse.getReadableWebStream() can't be used because the onRenderHtml() hook defined by vike-vue/__internal/integration/onRenderHtml provides a Readable Node.js Stream. Make sure the onRenderHtml() defined by vike-vue/__internal/integration/onRenderHtml hook provides a Readable Web Stream instead. See https://vike.dev/streaming for more information.
    at Object.getReadableWebStream (file:///D:/Web%20App%20Project/fungi/node_modules/.pnpm/vike@0.4.206_vite@5.4.11_@types+node@22.9.3_terser@5.36.0_/node_modules/vike/dist/esm/node/runtime/renderPage/getHttpResponseBody.js:44:17)
    at file:///D:/Web%20App%20Project/fungi/node_modules/.pnpm/vike-node@0.2.6_h3@1.13.0_hono@4.6.12_vike@0.4.206_vite@5.4.11_@types+node@22.9.3_terser@5.36_uuxpi4cs3hxikqiu33pmef63eu/node_modules/vike-node/dist/chunk-ZY4HROHC.js:254:32
    at Object.pipeInternal (file:///D:/Web%20App%20Project/fungi/node_modules/.pnpm/@universal-middleware+core@0.3.3_h3@1.13.0_hono@4.6.12/node_modules/@universal-middleware/core/dist/index.js:116:24)
    at dispatch (file:///D:/Web%20App%20Project/fungi/node_modules/.pnpm/hono@4.6.12/node_modules/hono/dist/compose.js:30:17)     
    at dispatch (file:///D:/Web%20App%20Project/fungi/node_modules/.pnpm/hono@4.6.12/node_modules/hono/dist/compose.js:30:17)     
    at secureHeaders2 (file:///D:/Web%20App%20Project/fungi/node_modules/.pnpm/hono@4.6.12/node_modules/hono/dist/middleware/secure-headers/secure-headers.js:79:5)
    at dispatch (file:///D:/Web%20App%20Project/fungi/node_modules/.pnpm/hono@4.6.12/node_modules/hono/dist/compose.js:30:17)     
    at csrf2 (file:///D:/Web%20App%20Project/fungi/node_modules/.pnpm/hono@4.6.12/node_modules/hono/dist/middleware/csrf/index.js:30:5)

And it will be fixed when disable the stream option in +config.ts.
The relevant dependency versions are as follows:

"hono": "^4.6.12"
"vike": "^0.4.206",
"vike-node": "^0.1.16",
"vike-vue": "^0.8.5", 
"vue": "^3.5.13",
@brillout
Copy link
Member

Alternatively you can set stream: 'web'. Closing in favor of #31.

@brillout brillout closed this as not planned Won't fix, can't repro, duplicate, stale Dec 10, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants