你能帮我解决这个错误吗?
(节点:6692) DEP0097 DeprecationWarning:不推荐在MakeCallback中使用域属性。使用MakeCallback的MakeCallback v或AsyncResource类代替。插件“webpack流”中未处理的拒绝错误
代码
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));
} 来自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"
}我应该升级/添加什么?
发布于 2019-11-25 09:43:02
我的朋友要求我解决这个问题,但我不能用我的系统来解决这个问题。
直到我找到这个文档
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.然后,更改节点版本后,通过升级并降级,使其工作正常,无错误得到。
这是运行时特定的节点v10问题。我不知道从哪里可以看出反对意见,但大多数时候是在异步/等待和承诺代码上。
发布于 2019-07-19 12:26:13
这个解决方案起作用了。在下面使用run选项:
run{ skipUncaughtErrors: true }
https://stackoverflow.com/questions/56440304
复制相似问题