[GH-ISSUE #339] React: Spreading props and setting a key causes crash #87

Closed
opened 2026-03-02 23:44:26 +03:00 by kerem · 0 comments
Owner

Originally created by @vdawg-git on GitHub (Nov 23, 2025).
Original GitHub issue: https://github.com/anomalyco/opentui/issues/339

Originally assigned to: @msmps on GitHub.

Spreading props and setting a key on an element causes SyntaxError crash in Bun.
Version:

"@opentui/core": "^0.1.49",
"@opentui/react": "^0.1.49",
"react": "^19.1.1"

Error

$ bun run --watch src/index.tsx
1 | })
2 | {
    ^
SyntaxError: Export named 'createElement' not found in module '/home/vdawg/dev/tmp-opentui-react/node_modules/@opentui/react/index.js'.
      at loadAndEvaluateModule (2:1)

Reproduction

Repo: https://github.com/vdawg-git/tmp-opentui-react-spread-bug-repro

import { createCliRenderer } from "@opentui/core"
import { createRoot } from "@opentui/react"

function App() {
	return (
		<box alignItems="center" justifyContent="center" flexGrow={1}>
			<box justifyContent="center" alignItems="flex-end">
				<ascii-font font="tiny" text="OpenTUI" />
				<text {...{}} key={"a"}>  // spread + key => crash
					hiii
				</text>
			</box>
		</box>
	)
}

const renderer = await createCliRenderer()
createRoot(renderer).render(<App />)
Originally created by @vdawg-git on GitHub (Nov 23, 2025). Original GitHub issue: https://github.com/anomalyco/opentui/issues/339 Originally assigned to: @msmps on GitHub. Spreading props and setting a key on an element causes `SyntaxError` crash in Bun. Version: ```json "@opentui/core": "^0.1.49", "@opentui/react": "^0.1.49", "react": "^19.1.1" ``` ## Error ```typescript $ bun run --watch src/index.tsx 1 | }) 2 | { ^ SyntaxError: Export named 'createElement' not found in module '/home/vdawg/dev/tmp-opentui-react/node_modules/@opentui/react/index.js'. at loadAndEvaluateModule (2:1) ``` ## Reproduction Repo: https://github.com/vdawg-git/tmp-opentui-react-spread-bug-repro ```typescript import { createCliRenderer } from "@opentui/core" import { createRoot } from "@opentui/react" function App() { return ( <box alignItems="center" justifyContent="center" flexGrow={1}> <box justifyContent="center" alignItems="flex-end"> <ascii-font font="tiny" text="OpenTUI" /> <text {...{}} key={"a"}> // spread + key => crash hiii </text> </box> </box> ) } const renderer = await createCliRenderer() createRoot(renderer).render(<App />) ```
kerem 2026-03-02 23:44:26 +03:00
  • closed this issue
  • added the
    bug
    react
    labels
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#87
No description provided.