macos webpack5 make a new plugin,use a hook thisCompilation and tap it. In the callback log the arameter 'compilation'. But show me a error "Function has non-object prototype 'null' in instanceof check"
class Plugin2 {
apply( compiler ) {
compiler.hooks.thisCompilation.tap( 'Plugin2', ( compilation ) => {
console.log( 'compilation' ) // its worked
console.log( compilation ) // Error
} )
}
}
module.exports = Plugin2
Error info:
[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)
update node to fix it.My node verssion is low https://github.com/nodejs/node/issues/35730