withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
46.79k stars 2.49k forks source link

React 19 Beta throws error when starting astro dev server #10940

Closed oemer-aran closed 6 months ago

oemer-aran commented 6 months ago

Astro Info

astro info
Astro v4.7.1
Noda v18.18.0
System Linux (x64)
Package Manager unknown
Output static
Adapter none
Integrations @astrojs/react

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

No response

Describe the Bug

Using React 19 Beta results in following error:

[ERROR] Missing "./server.js" specifier in "react-dom" package
  Stack trace:
    at C:\dev\project-name\node_modules\.pnpm\vite@5.2.11_@types+node@20.12.8\node_modules\vite\dist\node\chunks\dep-cNe07EU9.js:47597:25
    [...] See full stack trace in the browser, or rerun with --verbose.

I followed the official React 19 Beta installation guide: https://react.dev/blog/2024/04/25/react-19-upgrade-guide

If the stackblitz doesn't not show the error and just a blank screen, try npm install --force or yarn install.

What's the expected result?

Astro working with React 19 without any error.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/withastro-astro-2hppzz?file=package.json,.vscode%2Flaunch.json,src%2Fpages%2Findex.astro&title=Astro%20Starter%20Kit:%20Basics

Participation

matthewp commented 6 months ago

We don't currently support 19 which is currently in beta. I'll see what it takes to allow it.

zhondori commented 5 months ago

@matthewp hello Matthew. I'm also encountering this issue with my project. But error is little different.

 error   Missing "./errors" specifier in "astro" package

in my case I'm not even using React 19. its React 18.3.1. Astro version is 2.0.0

tparsons-godaddy commented 4 months ago

@zhondori I have the same error. Have you seen any updates?