-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Framework v1.13 building a broken version of React 19 #1866
Comments
To rule out machine-specific issues, I also performed the same steps above in Ubuntu on a different computer and got the same results. |
React has had a broken (incompatible with ES modules) distribution for quite some time facebook/react#11503, so we had to do a clunky workaround to get esbuild to convert it into a functional ES module: Lines 75 to 87 in 8efdcf4
It’s possible that they’ve changed something that will require us to do another workaround to get React 19 to work. It’s not a bug in Framework per se, but we’re willing to make changes to get React working again. |
For what it's worth I tried pinning Anything I can do to debug this further? |
I don’t think pinning React using rm -rvf src/.observablehq/cache/_npm
mkdir -p src/.observablehq/cache/_npm/react-dom@18.3.1
mkdir -p src/.observablehq/cache/_npm/react@18.3.1 That seems to workaround the problem in my testing. I’ll try to debug what’s broken in React 19 when I have time. |
Thanks for that workaround! I can confirm that it works for me as well. I inserted some extra commands in my Dockerfile to create those paths after |
Also experiencing this issue, and the workaround worked for me as well. Thank you! |
Unfortunately I'm unable to get it working with the workaround above, and the document page of React support is broken as well, is there a way to blacklist React 19 or pin to the previous version? |
Thank you for the quick fix! Is it possible to push a patched minor version to NPM so that CI builds which pull in the |
I'm opening an issue because I think I've found a bug while debugging an issue with my own work on the discussion forum.
Here are my steps to reproduce:
I installed a fresh version of Framework 1.13 using
npx @observablehq/framework@latest create
.I created a super simple JSX component in
components/Button.jsx
:I import and add this button to the existing
index.md
file:The above
display()
call is in a fencedjsx
block, sorry I don't know how to display that properly in here.Anyways, then I run
npm run dev
and load the homepage, and the button does not appear.I see this error in the browser console:
And sure enough in the client.js bundle it's importing the
_npm/react-dom@19.0.0
library but that file does not export a method calledcreateRoot
..Now, if I look in the
.observablehq/cache/_npm
folder I see that thereact-dom@19.0.0
folder contains one file:_esm.js
and that file is only 4,492 bytes.The same file in a previous Framework v11.1 project, for
react-dom@18.3.1
is around 192k ... Plus there are other files in that folder including apackage.json
etc.. Those other files are not present here in v1.13Similarly the
_esm.js
file in thecache/_npm/react@19.0.0
folder seems suspiciously small as well (11k)..This is all from a fresh vanilla install with no other changes except creating a basic JSX component to test.
I'm on a Mac (Sequoia 15.1.1) and I'm running Node 20.11.1
The text was updated successfully, but these errors were encountered: