Version: 0.28.1
Minimal repro (format: esm, platform: node, bundle: true):
// dep.mjs
export const tla = await Promise.resolve("x");
// a.mjs (a <-> b form a cycle; a also depends on the TLA module)
import { b } from "./b.mjs";
import { tla } from "./dep.mjs";
export function a() { return b() + tla; }
// b.mjs
import { a } from "./a.mjs";
export function b() { return typeof a; }
// entry.mjs (dynamic-import boundary forces __esm wrapping)
await import("./main.mjs");
// main.mjs
import { a } from "./a.mjs";
console.log(a());
Expected: either correct async-propagated output, or a build error.
Actual: build succeeds silently (0 warnings); node out.mjs throws SyntaxError: Unexpected reserved word. esbuild marks the init of the module that directly awaits TLA async, but fails to propagate async to the other members of the cyclic SCC, while still emitting await init_a() into their bodies:
var init_b = __esm({ "b.mjs"() { await init_a(); } }); // ← not async, but contains await
var init_a = __esm({ async "a.mjs"() { init_b(); await init_dep(); } });
The unbundled source runs fine under Node (valid ESM: the whole cycle is one async SCC). Two defects: (1) incomplete async-status propagation across import cycles; (2) invalid output emitted silently instead of erroring.
Version: 0.28.1
Minimal repro (format: esm, platform: node, bundle: true):
Expected: either correct async-propagated output, or a build error.
Actual: build succeeds silently (0 warnings);
node out.mjsthrowsSyntaxError: Unexpected reserved word. esbuild marks the init of the module that directly awaits TLA async, but fails to propagate async to the other members of the cyclic SCC, while still emittingawait init_a()into their bodies:The unbundled source runs fine under Node (valid ESM: the whole cycle is one async SCC). Two defects: (1) incomplete async-status propagation across import cycles; (2) invalid output emitted silently instead of erroring.