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

DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead #221

Open
AdeptSEO opened this issue May 6, 2020 · 5 comments

Comments

@AdeptSEO
Copy link

AdeptSEO commented May 6, 2020

mode: 'production' gives an error message

(node:5196) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead.

// gulpfile.js
function compileScripts() {
    return src('./app/js/main.js')
        .pipe(plumber({
            errorHandler: function(err) {
                console.log(chalk.red(err.message));
                this.emit('end');
            }
        }))
        .pipe(webpackStream(webpackConfig), webpack)
        .pipe(plumber.stop())
        .pipe(dest(filePaths.compileScripts.dest))
        .on('end', browserSync.reload);
}

// webpack.config.js
const path = require('path');
const isDevelopment = !process.env.NODE_ENV || process.env.NODE_ENV === 'development';

module.exports = {
    entry: {
        main: './app/js/main.js',
    },
    output: {
        path: path.resolve(__dirname, 'build', 'js'),
        filename: isDevelopment ? '[name].js' : '[name].min.js',
    },
    mode: isDevelopment ? 'development' : 'production',
    devtool: isDevelopment ? 'inline-cheap-module-source-map' : 'none',
    stats: isDevelopment ? 'errors-only' : 'normal',
    resolve: {
        alias: {
            ready: path.resolve(__dirname, 'app', 'js'),
            blocks: path.resolve(__dirname, 'app', 'views', 'blocks'),
            $: 'jquery',
            jQuery: 'jquery',
            jquery: 'jquery',
        },
    },
    module: {
        rules: [
            {
                test: /\.js$/,
                exclude: /(node_modules|bower_components)/,
                use: {
                    loader: 'babel-loader',
                },
            },
        ],
    },
    plugins: [],
};

npm 6.13.7
node v13.11.0
gulp CLI version: 2.2.0
gulp Local version: 4.0.2

@sc-illiakovalenko
Copy link

I have the same issue,

var stream = gulp.src(streamSource).pipe(webpack({ mode: 'production', stats: 'none', }))

can you look at this problem?

npm 6.11.13
node v10.16.3
gulp Local version: 4.02
gulp CLI version: 2.2.0

@eballeste
Copy link

@shotlandec1980 why did you close this? Did you find a solution?

@AdeptSEO
Copy link
Author

AdeptSEO commented Jun 14, 2020

@eballeste Unfortunately, I did not find a solution (
I don’t know why, but there are no more errors)
Оnly changed node.js to v12.18.0, but I don’t think that is the reason

@shama
Copy link
Owner

shama commented Oct 24, 2020

@shotlandec1980 @sc-illiakovalenko is this still an issue? This occurs because https://nodejs.org/docs/latest-v12.x/api/domain.html is deprecated in node 12 and likely because a module in the dependency was using it. I don't see that deprecation message with node 12 so I'm guessing a module removed the deprecation.

@Ubernt
Copy link

Ubernt commented Mar 4, 2021

@shama @shotlandec1980 Im getting this issue also after installing webpack-stream 6.1.2. It happens when I set the mode to production.

node.js: 12.8.4
npm: 6.14.6.

Update:
I managed to get this to work on suddenly on my local environment when developing. I only managed to get this to fail few times and after switching between development and production mode it stopped throwing error anymore. I tested this on another computer also and same thing there. Didnt work first times and after few try with different modes it works.

However on my workplace CI pipeline it always fails. I'm starting to think is there something happening on background after few tries and it works. CI pipeline always starts building website from scratch and it fails always when mode is production.

gulp is using a module which uses 'domain' module that is deprecated. Latest and version later than node.js 14.6 shouldn't care about it but for some reason setting mode to "production" makes it break. No idea how these two are related.

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

5 participants