Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
andrewpuch opened this issue May 10, 2024 · 2 comments
Open

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

andrewpuch opened this issue May 10, 2024 · 2 comments

Comments

@andrewpuch
Copy link

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.

@dnlup
Copy link
Owner

dnlup commented Aug 28, 2024

Hi @andrewpuch sorry to get back to you so late, what's your version of Node? Maybe there's something that needs better handling in the gc metrics with new versions.

@andrewpuch
Copy link
Author

@dnlup I didn't see your notification. I tested the same on Node 18 / 20.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants