I'm using node with gulp to run some building tasks. This worked fine until a couple days ago. Now (I assume after an upgrade/update, not sure which specific one. I believe it's the update of node from 14.4 to 14.5) I keep getting this warning
[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)
I cannot figure out how to use --trace-deprecation with gulp so I couldn't find what is triggering it.
My actual gulpfile is much longer and commenting out sections, changing pipeline to .pipe, updating node and dependencies, using async/await, and some other minor changing didn't get me any closer to narrowing down what the issue is.
Therefore I set up this minimal working example below:
- running the default gulp task (
clean_fake) does not trigger the warning - both
gulp cleanandgulp stylescause the warning to show
const gulp = require('gulp');
const del = require('del');
const sass = require('gulp-sass');
async function clean() {
const deletedPaths = await del([ './js/*.site.js', './style.css' ], { dryRun: true });
console.log('Deleted files and directories:\n', deletedPaths.join('\n'));
}
async function clean_fake() {
const deletedPaths = await test();
console.log('Deleted files and directories:\n', deletedPaths.join('\n'));
}
function test() {
console.log('dummy function');
return [ 'test' ];
}
function styles() {
return gulp.src('./src/sass/style.scss').pipe(sass()).pipe(gulp.dest('./'));
}
exports.clean = clean;
exports.styles = styles;
exports.default = clean_fake;
Current versions:
node: v14.5.0
npm: 6.14.6
del: 5.1.0
gulp: 4.0.2
gulp-sass: 4.1.0
PS: There is this similar question, but with no answer for my problem.
Update:
I figured out how to trace deprecation by running it with NODE_OPTIONS:
NODE_OPTIONS='--trace-deprecation' gulp
However the output didn't help me much
(node:146806) [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)