Skip to content

astro dev logs emitFile() serve-mode warning when @astrojs/react is enabled #15975

@smn-cds

Description

@smn-cds

Astro Info

Astro                    v6.0.5
Vite                     v7.3.1
Node                     v24.13.0
System                   macOS (arm64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             @astrojs/react (v5.0.0)

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

No response

Describe the Bug

Enabling the React integration in a minimal Astro app triggers this warning during astro dev:

[WARN] [vite] [plugin:astro:scripts] context method emitFile() is not supported in serve mode. This plugin is likely not vite-compatible.

This happens even in a very small repro with:

  • astro@6.0.5
  • @astrojs/react@5.0.0
  • react@19.2.4
  • react-dom@19.2.4

The app does not need any actual React component usage to reproduce it. The warning appears in dev mode when the React integration is enabled.

What's the expected result?

astro dev should start without the emitFile() compatibility warning when using the official @astrojs/react integration.

Since this is an Astro-maintained integration, I would expect it to be fully compatible with Astro/Vite dev mode and not log a warning that suggests an incompatible plugin.

Link to Minimal Reproducible Example

https://github.com/smn-cds/astro-emitfile-repro

Participation

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P2: nice to haveNot breaking anything but nice to have (priority)pkg: astroRelated to the core `astro` package (scope)pkg: reactRelated to React (scope)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions