A delay about 5 second is required after heap.start and heap.profile(), otherwise a blank snapshot is produced.
This code reproduces.
pprof.heap.start(intervalBytes, stackDepth)
const profile = pprof.heap.profile()
const buf = await pprof.encode(profile)