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

Does not work in node 16, TypeError: perf.getEntriesByName is not a function #18

Closed
patrickhulce opened this issue Apr 29, 2021 · 2 comments · Fixed by #19
Closed

Does not work in node 16, TypeError: perf.getEntriesByName is not a function #18

patrickhulce opened this issue Apr 29, 2021 · 2 comments · Fixed by #19

Comments

@patrickhulce
Copy link
Contributor

In node 16, performance is a global with the mark method (so the hrtime path isn't used), but it does not have getEntriesByName (so marky.stop throws an exception). Feature detection is now necessary for all the performance methods used :/

if (perf && perf.mark) {

Originally surfaced in GoogleChrome/lighthouse-ci#596

@mojavelinux
Copy link

The performance API in Node does not match the performance API for the web as documented on MDN (see https://developer.mozilla.org/en-US/docs/Web/API/Performance/getEntriesByName). Although the Node-specific performance API has been around since Node 10, in Node 16 an instance of this class is now bound to the global variable performance. That's where marky gets confused.

@mojavelinux
Copy link

Please consider merging the proposed PR and releasing a patch release. Right now, any software that depends on marky cannot be used on Node 16.

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

Successfully merging a pull request may close this issue.

2 participants