Skip to content

Astro v6 + Cloudflare + middleware + nodejs_compat leads to [object Object] on SSR pages. #15434

@n3dst4

Description

@n3dst4

Astro Info

Astro                    v6.0.0-beta.9
Vite                     v7.3.1
Node                     v24.13.0
System                   Linux (x64)
Package Manager          npm
Output                   server
Adapter                  @astrojs/cloudflare (v13.0.0-beta.5)
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

  • Astro v6-beta project
  • ...with the Cloudflare adapter
  • ...with "compatibility_flags": ["nodejs_compat"] in wrangler.jsonc
  • ...with any middleware (even a minimal return next())

...leads to SSR pages showing as [object Object] in the browser in preview mode and in deployment to CF only (dev mode is unaffected.)

Steps to reproduce

  1. Clone the repro repository.
  2. Install dependencies with pnpm install.
  3. Test the application: pnpm run preview.

What's the expected result?

The application should display the word "Astro", as per the minimal template.

Actual behaviour

The page displays [object Object].

Link to Minimal Reproducible Example

https://github.com/n3dst4/astro-cloudflare-middleware-repro

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageIssue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions