Skip to content

Possible bug: phantom VDOM node erroring render when using React Aria ListBoxItem #4539

Open
@eoncarlyle

Description

  • Check if updating to the latest Preact version resolves the issue

Describe the bug
A React Aria ComboBox containing ListBoxItem options fails to render with error Cannot set property previousSibling of #<Node>, render works normally for equivalent React application

To Reproduce

I created an issue demonstration repository here which uses the latest version of Preact (10.24.3 at time of writing). The issue demonstration repository is the bare minimum to reproduce the issue, and compares the erroring Preact application with the normally functioning, equivalent React application.

To reproduce the error in Preact and compare against the working React application, run the following after cloning the repository

$ npm --prefix preact install
$ npm --prefix preact run dev

In another terminal:

$ npm --prefix react install
$ npm --prefix react run dev

Note that

$ diff preact/src/app.tsx react/src/App.tsx
1,2c1,2
< import { useState } from "preact/hooks";
< import preactLogo from "./assets/preact.svg";
---
> import { useState } from "react";
> import reactLogo from "./assets/react.svg";
4c4
< import "./app.css";
---
> import "./App.css";
17a18
>

Observe the following in the developer console in the Preact application:

Uncaught TypeError: Cannot set property previousSibling of #<Node> which has only a getter
    at $681cc3c98f569e39$export$b34a105447964f9f.appendChild (Document.ts:119:13)
    at Object.insertBefore

Observe the following output in the React application:

image

Expected behavior
The Preact application should produce the same output as the React application. My best guess of what is going on is outlined here, it may be the case that Preact is attempting to render a layer of the VDOM hierarchy that does not exist, but I'm not certain.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions