SSR node middleware not working on Express #7870
Labels
- P4: important
Violate documented behavior or significantly impacts performance (priority)
feat: ssr
Related to SSR (scope)
pkg: node
Related to Node adapter (scope)
What version of
astro
are you using?2.9.6
Are you using an SSR adapter? If so, which one?
Node
What package manager are you using?
pnpm
What operating system are you using?
Windows
What browser are you using?
Chrome
Describe the Bug
When enabling SSR (
output: "server"
oroutput: "hybrid"
), with a middleware node adapter, the middleware is not working on Express (v4.18.2) when usingapp.use(ssrHandler)
, as shown in the docs:Instead, it works when using the middleware as follows:
I noticed it works as expected on Fastify (v4.21.0) with just
app.use(ssrHandler)
.This is my config:
This is my express server:
I created a repo to reproduce the error:
pnpm i
)pnpm build
)pnpm preview
)What's the expected result?
It should work with
app.use(ssrHandler)
.Please fix it or at least update the docs.
Link to Minimal Reproducible Example
https://github.com/marsidev/astro-ssr-example
Participation
The text was updated successfully, but these errors were encountered: