oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.24k stars 2.77k forks source link

v8.getHeapStatistics().heap_size_limit returns Infinity #12268

Closed malezjaa closed 4 months ago

malezjaa commented 4 months ago

What version of Bun is running?

1.1.17+bb66bba1b

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What steps can reproduce the bug?

const manifest = await pacote.manifest(spec.raw, opts);

const tarball = await pacote.tarball(manifest._resolved, {
  ...opts,
  Arborist,
  integrity: manifest._integrity,
});

This is what failes in pacote:

class PackumentCache extends LRUCache {
  static #heapLimit = Math.floor(getHeapStatistics().heap_size_limit) // Infinite

  ///...
  const maxSize = Math.floor(PackumentCache.#heapLimit * heapFactor)
 ///...
}

What do you see instead?

[20:53:50]  ERROR  maxSize must be a positive integer if specified
  at new LRUCache (C:\dev\briojs\bnp\node_modules\lru-cache\dist\commonjs\index.js:365:31)
  at new PackumentCache (C:\dev\briojs\bnp\node_modules\@npmcli\arborist\lib\packument-cache.js:30:5)
  at new Arborist (C:\dev\briojs\bnp\node_modules\@npmcli\arborist\lib\arborist\index.js:85:49)
  at <anonymous> (C:\dev\briojs\bnp\node_modules\pacote\lib\dir.js:71:32)
  at <anonymous> (C:\dev\briojs\bnp\node_modules\pacote\lib\dir.js:69:25)
  at processTicksAndRejections (:12:39)
malezjaa commented 4 months ago

Never mind, fixed on canary