Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NodeJS [DEP0097] DeprecationWarning:

Can you help me with this error?

(node:6692) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context v ariant of MakeCallback or the AsyncResource class instead. Unhandled rejection Error in plugin "webpack-stream"

the codeis

import gulp from 'gulp';
import yargs from 'yargs';
import sass from 'gulp-sass';
import cleanCSS from 'gulp-clean-css';
import gulpif from 'gulp-if';
import sourcemaps from 'gulp-sourcemaps';
import imagemin from 'gulp-imagemin';
import del from 'del';
import webpack from 'webpack-stream';  

export const scripts = () => {
    return gulp.src(paths.scripts.src)
    .pipe(webpack({
        module: {
            rules: [{
                test: /\.js$/,
                use: {
                    loader: 'babel-loader',
                    options: {
                        presets: ['@babel/preset-env']
                    }
                }
                }]
        },
        output : {
            filename: 'bundle.js'
        }
    }))
    .pipe(gulp.dest(paths.scripts.dest));
} 

and from package.json:

    "devDependencies": {
    "@babel/core": "^7.4.5",
    "@babel/preset-env": "^7.4.5",
    "babel-loader": "^7.1.5",
    "babel-preset-env": "^1.7.0",
    "babel-register": "^6.26.0",
    "del": "^4.1.1",
    "gulp": "^4.0.2",
    "gulp-clean-css": "^4.2.0",
    "gulp-if": "^2.0.2",
    "gulp-imagemin": "^6.0.0",
    "gulp-sass": "^4.0.2",
    "gulp-sourcemaps": "^2.6.5",
    "node-sass": "^4.12.0",
    "webpack": "^4.32.2",
    "webpack-stream": "^5.2.1",
    "yargs": "^13.2.4"
  }

what should I upgrade/add?

like image 804
Dragos Jianu Avatar asked Jun 04 '19 08:06

Dragos Jianu


People also ask

Is Nodejs 12 deprecated?

On November 1, 2022, the GitHub and npm release for AWS SDK for JavaScript (v3) will update engines field in package. json to drop support for Node. js 12.

Is Nodejs deprecated?

js would be necessary to use this cloud function after Feb/Mar 2021. Node. js 8 has been deprecated. Starting Feb 15, 2021, we'll no longer support new deploys or updates of Node.

What version of Node works with Gulp 4?

Gulp 3.9. 1 will work with Node 8 (latest noded 8 is 8.17.

Which inbuilt module is deprecated now in node js?

The util.8.0_ method is an inbuilt application programming interface of the util module which wraps fn (which may be a function or class) in such a way that it is marked as deprecated.


1 Answers

My friend asks me to solve this problem but I can't regenerate this problem with my system.

Until I found this Doc

DEP0097: MakeCallback with domain property#
node v10.0.0
Runtime deprecation.
Type: Runtime

Users of MakeCallback that add the domain property to carry context, should start 
using the async_context variant of MakeCallback or CallbackScope, or the 
high-level AsyncResource class.

Then After change node version by the upgrade and downgrade it working fine no error got.

It is a specific node v10 problem at runtime. I don't have any idea from where deprecation show but most of the time it is on async/await and promise code.

like image 200
Ashok Avatar answered Sep 28 '22 13:09

Ashok