Skip to content

heisenbug #4097

@kzc

Description

@kzc
  • Rollup Version: rollup v2.50.0
  • Operating System (or Browser): n/a
  • Node Version (if applicable): v16.1.0

Repro

2.50.0 REPL

$ cat heisenbug.js 
function heisenbug() {
    var a;
    function f(b) {
        if (a) console.log(a === b.c ? "PASS" : "FAIL");
        a = b.c;
    }
    function g() {}
    function h() {
        f({
            c: g
        });
    }
    h();
    h();
}
heisenbug();
heisenbug();

// if following line is commented out then rollup generates an empty chunk
//console.log(123);

Expected Behavior

$ cat heisenbug.js | node
PASS
PASS

Actual Behavior

$ cat heisenbug.js | rollup

- → stdout...

(!) Generated an empty chunk

This example worked in rollup 2.48.0.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions