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

Deprecation warning since Node 14.5.0 #2460

Closed
4 tasks done
ehmicky opened this issue Jul 1, 2020 · 5 comments
Closed
4 tasks done

Deprecation warning since Node 14.5.0 #2460

ehmicky opened this issue Jul 1, 2020 · 5 comments

Comments

@ehmicky
Copy link

ehmicky commented Jul 1, 2020

Before you open this issue, please complete the following tasks:

  • use the search bar at the top of the page to search this repository for similar issues or discussions that have already been opened.
  • if you are looking for help from the gulp team or community, open a discussion.
  • if you think there is a problem with the plugin you're using, open a discussion.
  • if you think there is a bug in our code, open this issue.

What were you expecting to happen?

No deprecation warning should be printed on the console since Node 14.5.0.

What actually happened?

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.

Please give us a sample of your gulpfile

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

Please provide the following information:

  • OS & version: Ubuntu 20.04
  • node version: v14.5.0
  • npm version: v6.14.5
  • gulp version: CLI version: 2.3.0, Local version: 4.0.2
@ehmicky ehmicky mentioned this issue Jul 3, 2020
4 tasks
@laurent22
Copy link

I 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)

@fasttime
Copy link

fasttime commented Jul 6, 2020

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 module in one of its transitive dependencies (async-done).

└─┬ gulp@4.0.2
  ├─┬ glob-watcher@5.0.3
  │ └── async-done@1.3.2 
  └─┬ undertaker@1.2.1
    └─┬ bach@1.2.0
      ├── async-done@1.3.2  deduped
      └─┬ async-settle@1.0.0
        └── async-done@1.3.2  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.

@noahbrenner
Copy link

Looks like warning was the result of nodejs/node#33801, but showing the warning was unintentional and was addressed by nodejs/node#34245 (which was merged, despite the GitHub status shown). Hopefully that fix will show up in the next released node version.

@AlexanderOMara
Copy link

AlexanderOMara commented Jul 23, 2020

The deprecation warning is no longer shown in Node 14.6.0.

@phated
Copy link
Member

phated commented Jul 23, 2020

@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.

@phated phated closed this as completed Jul 23, 2020
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

6 participants