mat*_*eos 5 javascript node.js
我在我的程序中收到了这个警告,我最近更新到了 Node 10,我试图找出弃用警告的来源:
[DEP0079] DeprecationWarning: Custom inspection function on Objects via .inspect() is deprecated
如何跟踪此错误的来源?
附注。我已经在 CLI 上尝试过--trace-warnings,--trace-deprecation但没有运气
mat*_*eos 19
OP Here
Since --trace-warnings and --trace-deprecation didn't show a stacktrace, I found another way that did:
process.on('warning', (warning) => {
console.log(warning.stack);
});
Run Code Online (Sandbox Code Playgroud)
使用NODE_OPTIONS:
"scripts": {
"start": "cross-env NODE_OPTIONS=--trace-deprecation react-scripts start",
},
Run Code Online (Sandbox Code Playgroud)