Before you open this issue, please complete the following tasks:
No deprecation warning should be printed on the console since Node 14.5.0.
A deprecation warning is printed on the console since Node 14.5.0.
(node:47881) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead.
const gulp = require('gulp')
module.exports.example = function () {
return gulp.src([__filename])
}
$ gulp example
[01:17:58] Using gulpfile ~/Desktop/gulpfile.js
[01:17:58] Starting 'example'...
(node:47881) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
[01:17:58] Finished 'example' after 14 ms
20.04v14.5.0v6.14.5CLI version: 2.3.0, Local version: 4.0.2I don't know if that can be of any help, but this is the full stacktrace:
(node:4478) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead.
at emitMakeCallbackDeprecation (domain.js:123:13)
at FSReqCallback.topLevelDomainCallback (domain.js:134:5)
at FSReqCallback.callbackTrampoline (internal/async_hooks.js:121:14)
I managed to silence the warning by adding this code at the top of my gulpfile.js, before the first require.
{
const { emitWarning } = process;
process.emitWarning =
(warning, type, code, ...extraArgs) =>
code !== 'DEP0097' && emitWarning(warning, type, code, ...extraArgs);
}
The root of the problem is that gulp uses the [domain](https://nodejs.org/docs/latest/api/domain.html) module in one of its transitive dependencies ([async-done](https://www.npmjs.com/package/async-done)).
โโโฌ [email protected] โโโฌ [email protected] โ โโโ [email protected] โโโฌ [email protected] โโโฌ [email protected] โโโ [email protected] deduped โโโฌ [email protected] โโโ [email protected] deduped
The domain module has been pending deprecation for years, but no equally usable alternative exists yet, which is a shame. Not sure why Node.js started to emit the warning in version 14.5.0 though. At least I couldn't spot a mention of it in the release notes.
Looks like warning was the result of https://github.com/nodejs/node/pull/33801, but showing the warning was unintentional and was addressed by https://github.com/nodejs/node/pull/34245 (which was merged, despite the GitHub status shown). Hopefully that fix will show up in the next released node version.
The deprecation warning is no longer shown in Node 14.6.0.
@AlexanderOMara thanks for the update! And huge thanks to @noahbrenner and everyone else that helped track the upstream problems!
I'm going to close this out now.
Most helpful comment
Looks like warning was the result of https://github.com/nodejs/node/pull/33801, but showing the warning was unintentional and was addressed by https://github.com/nodejs/node/pull/34245 (which was merged, despite the GitHub status shown). Hopefully that fix will show up in the next released node version.