Skip to content

Server Islands not rendering as islands in .mdx files #12252

Open
@ColeTownsend

Description

@ColeTownsend

Astro Info

Astro                    v4.16.5
Node                     v22.9.0
System                   macOS (arm64)
Package Manager          npm
Output                   server
Adapter                  @astrojs/cloudflare
Integrations             @astrojs/mdx
                         @astrojs/react
                         astro-meta-tags
                         @astrojs/tailwind
                         pagefind

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

No response

Describe the Bug

Astro components imported into .mdx files that use prop server:dever are rendered the same way as the page, i.e. dynamically or prerendered. I'm experiencing this using cloudflare adapter, but for the example I had to use nodejs for stackblitz.

Server islands should not delay the entire page render in dev mode (seems to cause waterfall), and when pre-rendered should not be output statically.

Example

You can observer within the dist folder under client the entire page is rendered to static html, including the server island.

image

What's the expected result?

The server island should behave the same as it does within an .astro file.

Link to Minimal Reproducible Example

Note: you will need to run npm start to generate a preview build.
https://stackblitz.com/edit/github-njjrmi?file=src%2Fpages%2Findex.astro

Participation

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

Metadata

Metadata

Assignees

Labels

- P4: importantViolate documented behavior or significantly impacts performance (priority)feat: server islandsRelated to Server Islands (scope)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions