Skip to content

compilePackages: react-dom/server renderToStaticMarkup returns empty string #5139

Description

@proggeramlug

Perry: origin/main @ a674b6e (v0.5.1167) · macOS arm64
Setup: package compiled natively via perry.compilePackages (perry.allow.compilePackages: ["*"])
Build/run: perry repro.ts -o out && ./out

(Found via an internal real-package stress run — importing the real package and exercising it.)

Bug

renderToStaticMarkup(createElement(...)) returns an empty string instead of the rendered HTML. The program exits 0 but produces no markup — SSR yields nothing.

Repro

import { createElement } from 'react';
import { renderToStaticMarkup } from 'react-dom/server';

function Item({ n }) { return createElement('li', null, `item-${n}`); }
const list = createElement('ul', { id: 'L' }, [1, 2, 3].map((n) => createElement(Item, { key: n, n })));
console.log(renderToStaticMarkup(list));

Expected (Node)

<ul id="L"><li>item-1</li><li>item-2</li><li>item-3</li></ul>

Actual (Perry)

(empty string)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed defect or regressionparityCompatibility gap with Node.js, ECMAScript, or the supported ecosystem

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions