Skip to content

The value of "val" is out of range. #627

@andrewpuch

Description

@andrewpuch

Hello,

I've been seeing some intermittent failures with this error.

The value of "val" is out of range. It must be a safe integer greater than 0. Received 0

Based on the stack trace it's coming from here.

https://github.com/dnlup/doc/blob/next/lib/gc.js#L71

The code I have that should be throwing the error is simplified here.

const doc = require('@dnlup/doc');

const sampler = doc({
  collect: {
    gc: true,
    cpu: false,
    memory: false,
    resourceUsage: false,
    eventLoopDelay: false,
    eventLoopUtilization: false,
    activeHandles: false,
  },
});

sampler.on('sample', () => {
  // Other functionality here
});

Is there something on my end that could be wrong and causing this error to be thrown intermittently? It's not easily reproducible.

Thank you.

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