{"id":85797,"date":"2020-05-11T15:43:00","date_gmt":"2020-05-11T07:43:00","guid":{"rendered":"http:\/\/4563.org\/?p=85797"},"modified":"2020-05-11T15:43:00","modified_gmt":"2020-05-11T07:43:00","slug":"%e6%b1%82%e5%8a%a9%e5%85%b3%e4%ba%8e-js-error-stack-%e7%9a%84%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=85797","title":{"rendered":"\u6c42\u52a9\u5173\u4e8e js Error.stack \u7684\u95ee\u9898"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u6c42\u52a9\u5173\u4e8e js Error.stack \u7684\u95ee\u9898               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xiaoming1992 <\/span>  <span><i><\/i> 3<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6211\u5e0c\u671b\u5bf9<code>Error.stack<\/code>\u505a\u8fdb\u4e00\u6b65\u7684\u5904\u7406(\u5176\u5b9e\u5c31\u662f\u4e0d\u663e\u793a<code>name<\/code>\u548c<code>message<\/code>\u90a3\u4e00\u884c), \u4f46\u662f\u53ea\u8981\u4e00\u5904\u7406, \u5c31\u4e0d\u80fd\u6620\u5c04\u5230<code>sourceMap<\/code>\u4e86, \u4ee3\u7801\u548c\u6253\u5370\u7ed3\u679c\u5982\u4e0b, can you help help me?<\/p>\n<pre><code>const { stack } = new Error(\"\") if (stack) {   console.log(stack)   console.log(stack.split(\"n\").splice(1).join(\"n\")) } <\/code><\/pre>\n<pre><code>\/\/ \u8fd9\u662f console.log(stack) \/\/ sourceMap \u6b63\u786e Error     at log (index.ts:7)     at withinRect (index.tsx:39)     at index.tsx:202     at updateMemo (react-dom.development.js:16835)     at Object.useMemo (react-dom.development.js:17315)     at useMemo (react.development.js:1643)     at App (index.tsx:202)     at renderWithHooks (react-dom.development.js:16241)     at updateFunctionComponent (react-dom.development.js:18328)     at beginWork$1 (react-dom.development.js:20151)   \/\/ \u8fd9\u662f console.log(stack.split(\"n\").splice(1).join(\"n\")) \/\/ sourceMap \u9519\u8bef     at log ( http:\/\/192.168.3.7:8080\/static\/scripts\/index.e7695f.js?e7695f02d813f4d2c31a:66434:17)     at withinRect ( http:\/\/192.168.3.7:8080\/static\/scripts\/index.e7695f.js?e7695f02d813f4d2c31a:65917:59)     at http:\/\/192.168.3.7:8080\/static\/scripts\/index.e7695f.js?e7695f02d813f4d2c31a:66044:96     at updateMemo ( http:\/\/192.168.3.7:8080\/static\/scripts\/index.e7695f.js?e7695f02d813f4d2c31a:41208:19)     at Object.useMemo ( http:\/\/192.168.3.7:8080\/static\/scripts\/index.e7695f.js?e7695f02d813f4d2c31a:41688:16)     at useMemo ( http:\/\/192.168.3.7:8080\/static\/scripts\/index.e7695f.js?e7695f02d813f4d2c31a:54182:21)     at App ( http:\/\/192.168.3.7:8080\/static\/scripts\/index.e7695f.js?e7695f02d813f4d2c31a:66044:74)     at renderWithHooks ( http:\/\/192.168.3.7:8080\/static\/scripts\/index.e7695f.js?e7695f02d813f4d2c31a:40614:18)     at updateFunctionComponent ( http:\/\/192.168.3.7:8080\/static\/scripts\/index.e7695f.js?e7695f02d813f4d2c31a:42701:20)     at beginWork$1 ( http:\/\/192.168.3.7:8080\/static\/scripts\/index.e7695f.js?e7695f02d813f4d2c31a:44524:16) <\/code><\/pre>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>3<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"1495057\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : YadongZhang <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u597d\u50cf\u529b\u6263\u524d\u7aef\u7b14\u8bd5\u9898\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1495058\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : xiaoming1992 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @YadongZhang \u521a\u521a\u8bd5\u4e86\u4e00\u4e0b\uff0csourceMap \u53d1\u751f\u65f6\u673a\u5e94\u8be5\u662f\u5728 console.log \u4e4b\u540e\uff0c\u6839\u636e console.log \u6253\u5370\u51fa\u7684\u5b57\u7b26\u4e32\u8fdb\u884c\u66ff\u6362\u3002\u5e76\u4e14 Error \u7684 name \u5e94\u8be5\u5fc5\u987b\u662f\u539f\u751f Error \u7684 name\uff0c\u53ea\u8981\u4fdd\u7559\u7b2c\u4e00\u884c\u7684 Error name\uff0c\u540e\u9762\u7684\u884c\u53ef\u8fdb\u884c\u5220\u51cf\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1495059\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Arrowing <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6ca1\u6709\u8fc7\u8fd9\u6837\u7684\u9700\u6c42\uff0c\u5148\u63d2\u773c                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u6c42\u52a9\u5173\u4e8e js Error.sta&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/85797"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=85797"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/85797\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=85797"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=85797"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=85797"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}