bun icon indicating copy to clipboard operation
bun copied to clipboard

node:v8 getHeapSpaceStatistics is not yet implemented in Bun

Open 0x524c opened this issue 2 years ago • 10 comments

What version of Bun is running?

1.0.18 macOS

What platform is your computer?

ARM64

What steps can reproduce the bug?

My project uses the Moleculer framework. It depends on a node:v8 getHeapSpaceStatistics that does not yet exist in Bun. Is there any chance of this API being developed?

Repo demo https://github.com/524c/moleculer-bun-demo

[2023-12-15T16:15:57.091Z] INFO  mac1.local-6540/BROKER: Moleculer v0.14.32 is starting...
[2023-12-15T16:15:57.091Z] INFO  mac1.local-6540/BROKER: Namespace: esm
[2023-12-15T16:15:57.091Z] INFO  mac1.local-6540/BROKER: Node ID: mac1.local-6540
[2023-12-15T16:15:57.092Z] INFO  mac1.local-6540/METRICS: Metrics: Enabled
[2023-12-15T16:15:57.094Z] INFO  mac1.local-6540/METRICS: Metric reporter: PrometheusReporter
[2023-12-15T16:15:57.095Z] DEBUG mac1.local-6540/METRICS: Registering common metrics...
[2023-12-15T16:15:57.096Z] DEBUG mac1.local-6540/METRICS: Registered 54 common metrics.
[2023-12-15T16:15:57.096Z] DEBUG mac1.local-6540/METRICS: Update common metric values...
[2023-12-15T16:15:57.096Z] FATAL mac1.local-6540/BROKER: Unable to create ServiceBroker. ::bunternal:: [NotImplementedError]: node:v8 getHeapSpaceStatistics is not yet implemented in Bun.
    at new NotImplementedError (internal:shared:13:14)
    at <anonymous> (internal:shared:2:35)
    at <anonymous> (node:v8:2:23)
    at <anonymous> (node:v8:26:37)
    at updateCommonMetrics (/Users/rlucas/Desktop/moleculer-bun-demo/node_modules/moleculer/src/metrics/commons.js:314:32)
    at init (/Users/rlucas/Desktop/moleculer-bun-demo/node_modules/moleculer/src/metrics/registry.js:33:134)
    at new ServiceBroker (/Users/rlucas/Desktop/moleculer-bun-demo/node_modules/moleculer/src/service-broker.js:12:412)
    at <anonymous> (/Users/rlucas/Desktop/moleculer-bun-demo/node_modules/moleculer/src/runner-esm.mjs:201:40)
    at startBroker (/Users/rlucas/Desktop/moleculer-bun-demo/node_modules/moleculer/src/runner-esm.mjs:196:23)
    at processTicksAndRejections (:61:39) {
  code: 'ERR_NOT_IMPLEMENTED',
  originalLine: 13,
  originalColumn: 14
}

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

Moleculer metrics

0x524c avatar Dec 15 '23 16:12 0x524c

It's tricky to support most of the node:v8 APIs, since they are usually specific to V8. However, it looks like we could conceivably support this API.

Electroid avatar Dec 19 '23 22:12 Electroid

That would be wonderful 🚀🎉

My project consists of a frontend in sveltekit, a backend that depends on Moleculer that runs on Kubernetes and exports Prometheus that depend on this node API.

In development, I already migrated everything to run with Bun, but in production I only got the Frontend due to the lack of this nodejs API. That's all it takes to migrate 100%.

0x524c avatar Dec 19 '23 23:12 0x524c

any updates?

hpawa avatar Aug 13 '25 18:08 hpawa

any updates?

westtrade avatar Sep 30 '25 14:09 westtrade

any updates?

de-n3xus avatar Oct 09 '25 17:10 de-n3xus

any updates?

MarcStdt avatar Oct 20 '25 22:10 MarcStdt

any updates?

nemvince avatar Dec 02 '25 00:12 nemvince

any updates?

0x524c avatar Dec 02 '25 00:12 0x524c

Any updates? Thanks 😄

orekav avatar Dec 03 '25 13:12 orekav