-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Unactionable "Label ... already exists for debuglog.time
" warning since Node.js 22.6
#54265
Comments
Maybe this is caused by 01cf9bc, which added some conditions in |
debuglog.time
label warning since Node.js 22.6debuglog.time
label" warning since Node.js 22.6
debuglog.time
label" warning since Node.js 22.6debuglog.time
" warning since Node.js 22.6
I can reproduce this locally! I will create a minimal reproduction. |
Minimal reproductionPut these files in a folder and run // index.js
const Module = require("module");
const requireDep2 = require("./dep1.js");
const globalCache = Module._cache;
Module._cache = Object.create(null);
require("./require-hook.js");
Module._cache = globalCache;
requireDep2(); // dep1.js
module.exports = function requireDep2() {
require("./dep2.js");
}; // dep2.js
// (empty) // require-hook.js
const Module = require("module");
const requireDep2 = require("./dep1.js");
const originalJSLoader = Module._extensions[".js"];
Module._extensions[".js"] = function customJSLoader(module, filename) {
requireDep2();
return originalJSLoader(module, filename);
}; This pattern of running the require hook with a "clean cache" is currently used by I would expect two things:
cc @H4ad, since you probably know what is going on here :) Btw, Babel was added to CITGM a few weeks ago (nodejs/citgm#628) and it should have caught this, however I don't see Babel in the CITGM run for Node.js 22.6.0. What happened here? |
A change in behaviour in npm 10.8.2 (npm/cli#7704 (comment)) meant that the CITGM runs for Node.js 22 (and main) are installing an outdated version of CITGM (before Babel was added). |
|
I opened a PR to fix it, thanks for the report ❤️ |
Co-authored-by: James M Snell <jasnell@gmail.com>
Co-authored-by: James M Snell <jasnell@gmail.com>
Co-authored-by: James M Snell <jasnell@gmail.com>
Co-authored-by: James M Snell <jasnell@gmail.com>
Version
22.6.0
Platform
This is also happening on Windows/Linux/MacOS on GitHub actions.
Linux ... 6.9.3-76060903-generic #202405300957~1718348209~22.04~7817b67 SMP PREEMPT_DYNAMIC Mon J x86_64 x86_64 x86_64 GNU/Linux
Subsystem
modules or diagnostics channel
What steps will reproduce the bug?
I apologize because I don't actually have any steps to reproduce this, other than "run https://github.com/babel/babel 's tests on GitHub actions" and I know that this is not enough info. My hope is that by opening this issue somebody can help me figuring out how to create a reproduction.See #54265 (comment)
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
/
What do you see instead?
Since the 22.6 release, we started seeing some warnings in Babel's CI like the following:
We caught it because it's happening in a test where we spawn a Node.js process and check the stderr.
If I run with
--trace-warnings
, I get this trace:Additional information
From that trace, it seems like the warning is not coming from a label that we create in our code, but from a label that Node.js creates internally (and this is why I believe that this warning is a bug) at https://github.com/nodejs/node/blob/90dea9e3e003945f113aaca09c45f963fe566a47/lib/internal/modules/cjs/loader.js#L211C9-L211C17.
It looks like that code was touched a few months ago, but those changes had already been released in previous minor releases. However, we only see the the warning with Node.js 22.6.0 and not with 22.5.1.
Also, from that code it's not obvious to me how that label can be registered twice, because
require()
is sync and thus tworequire()
calls to the same file cannot happen in parallel 🤔The text was updated successfully, but these errors were encountered: