Skip to content

compilePackages: rxjs program exits 13 with 'Detected unsettled top-level await' #5138

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

An await firstValueFrom(of(...).pipe(...)) against rxjs never settles — the process exits 13 with Warning: Detected unsettled top-level await. The observable pipeline appears not to drive its subscriber to completion.

Repro

import { of, map, filter, reduce, firstValueFrom } from 'rxjs';

const sum = await firstValueFrom(of(1, 2, 3, 4, 5).pipe(filter((x) => x % 2 === 1), map((x) => x * 10), reduce((a, b) => a + b, 0)));
console.log(sum);

Expected (Node)

90

Actual (Perry)

exit 13 — Detected unsettled top-level await

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