Skip to content

DeprecationWarning when running Node 16 #435

Closed
@oskarolsson-jimdo

Description

@oskarolsson-jimdo

Hi!

It seems starting with Node 16 there's a deprecating warning stemming from prom-client.

We're using a simple setup of prom.collectDefaultMetrics();

With node@16.0.0, npm@7.5.6 and using --trace-deprecation to run our server, we get the following (replaced irrelevant paths with [...]):

(node:22429) [DEP0152] DeprecationWarning: Custom PerformanceEntry accessors are deprecated. Please use the detail property.
    at PerformanceObserver.<anonymous> (/[...]/node_modules/prom-client/lib/metrics/gc.js:47:38)
    at PerformanceObserver.[kDispatch] (node:internal/perf/observe:261:34)
    at Immediate.<anonymous> (node:internal/perf/observe:94:25)
    at processImmediate (node:internal/timers:464:21)
/[...]/node/16.0.0/bin/node[22429]: ../src/env-inl.h:1052:void node::Environment::AddCleanupHook(node::Environment::CleanupCallback, void*): Assertion `(insertion_info.second) == (true)' failed.
 1: 0xb12b00 node::Abort() [/[...]/node/16.0.0/bin/node]
 2: 0xb12b7e  [/[...]/node/16.0.0/bin/node]
 3: 0xb7a58c  [/[...]/node/16.0.0/bin/node]
 4: 0xd5f70b  [/[...]/node/16.0.0/bin/node]
 5: 0xd60bac  [/[...]/node/16.0.0/bin/node]
 6: 0xd61226 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [/[...]/node/16.0.0/bin/node]
 7: 0x160c579  [/[...]/node/16.0.0/bin/node]

Looking at the changelog for Node 16, it seems this is most likely related to this change that overhauled perf_hooks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions