compilation TypeError: Function has non-object prototype 'null' in instanceof check
compilation TypeError: Function has non-object prototype 'null' in instanceof check
苹果电脑
网页包5
制作一个新插件,使用钩子 thisCompilation 并点击它。在回调日志中,参数 'compilation'。但显示错误“函数在 instanceof 检查中具有非对象原型 'null'”
class Plugin2 {
apply( compiler ) {
compiler.hooks.thisCompilation.tap( 'Plugin2', ( compilation ) => {
console.log( 'compilation' ) // its worked
console.log( compilation ) // Error
} )
}
}
module.exports = Plugin2
错误信息:
[webpack-cli] TypeError: Function has non-object prototype 'null' in instanceof check
at Function.[Symbol.hasInstance] (<anonymous>)
at getConstructorName (internal/util/inspect.js:545:13)
at formatRaw (internal/util/inspect.js:813:23)
at formatValue (internal/util/inspect.js:803:10)
at formatProperty (internal/util/inspect.js:1689:11)
at formatRaw (internal/util/inspect.js:1017:9)
at formatValue (internal/util/inspect.js:803:10)
at formatProperty (internal/util/inspect.js:1689:11)
at formatRaw (internal/util/inspect.js:1017:9)
at formatValue (internal/util/inspect.js:803:10)
更新节点以修复it.My节点版本低
https://github.com/nodejs/node/issues/35730
苹果电脑 网页包5 制作一个新插件,使用钩子 thisCompilation 并点击它。在回调日志中,参数 'compilation'。但显示错误“函数在 instanceof 检查中具有非对象原型 'null'”
class Plugin2 {
apply( compiler ) {
compiler.hooks.thisCompilation.tap( 'Plugin2', ( compilation ) => {
console.log( 'compilation' ) // its worked
console.log( compilation ) // Error
} )
}
}
module.exports = Plugin2
错误信息:
[webpack-cli] TypeError: Function has non-object prototype 'null' in instanceof check
at Function.[Symbol.hasInstance] (<anonymous>)
at getConstructorName (internal/util/inspect.js:545:13)
at formatRaw (internal/util/inspect.js:813:23)
at formatValue (internal/util/inspect.js:803:10)
at formatProperty (internal/util/inspect.js:1689:11)
at formatRaw (internal/util/inspect.js:1017:9)
at formatValue (internal/util/inspect.js:803:10)
at formatProperty (internal/util/inspect.js:1689:11)
at formatRaw (internal/util/inspect.js:1017:9)
at formatValue (internal/util/inspect.js:803:10)
更新节点以修复it.My节点版本低 https://github.com/nodejs/node/issues/35730