Skip to content

Framework v1.13 building a broken version of React 19 #1866

Closed
@sbarre

Description

@sbarre

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:

import * as React from "npm:react";

export default function Button() {
  return (
    <button>Test</button>
  )
}

I import and add this button to the existing index.md file:

import Button from './components/Button.js';

display(<Button />)

The above display() call is in a fenced jsx 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:

Uncaught (in promise) TypeError: createRoot is not a function at client.js:211:19

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 called createRoot..

Now, if I look in the .observablehq/cache/_npm folder I see that the react-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 a package.json etc.. Those other files are not present here in v1.13

Similarly the _esm.js file in the cache/_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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn’t working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions