Skip to content

[v6 + Cloudflare] Markdoc component <style> not extracted in dev server #16013

@CaiJimmy

Description

@CaiJimmy

Astro Info

Astro                    v6.0.7
Node                     v25.8.1
System                   macOS (arm64)
Package Manager          pnpm
Output                   static
Adapter                  @astrojs/cloudflare
Integrations             @astrojs/markdoc

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

All.

Describe the Bug

Styles defined in custom Markdoc component are not applied in the dev server with Cloudflare adapter. This does not affect the final production build.

After some testing, this bug is triggered when we have some level of indirection when calling the <Content> component from await render(entry);: if <Content> is used in [...slugs].astro directly, then this bug does not occur.

However, if we create a separate <PostContent> Astro component and we pass entry as parameter, then call await render(entry) inside it, the bug is triggered (see reproduction repo).

Page in dev server:

Image

Same page in preview server, notice that we have now an inline style tag in head:

Image

To see the error, you should navigate to /blog/test page after starting the dev / preview server.

What's the expected result?

The styling in dev server should be the same as in preview environment (production build).

Link to Minimal Reproducible Example

https://github.com/CaiJimmy/astro-v6-cloudflare-markdoc-component-style

Participation

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

Metadata

Metadata

Assignees

Labels

- P3: minor bugAn edge case that only affects very specific usage (priority)pkg: astroRelated to the core `astro` package (scope)pkg: cloudflareRelated to the Cloudflare adapterpkg: markdocRelated to the `@astrojs/markdoc` package (scope)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions