You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2022/04/14 06:41:13 UTC

[GitHub] [skywalking] SiuChau opened a new issue, #8876: [Bug] skywalking-client-js reporting error unnormal on SPA

SiuChau opened a new issue, #8876:
URL: https://github.com/apache/skywalking/issues/8876

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/skywalking/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Apache SkyWalking Component
   
   NodeJS Client Side Agent (apache/skywalking-client-js)
   
   ### What happened
   
   in browser panal, the error information skywalking-client-js collects always come from the single page,even I already set enableSPA=true.
   
   first enter page A, then enter page B and triggering errors in page B, DevToolds network shown that it send three request, two is perfData,one is errorlog.
   the perfData's pagePath is correct path,and I believe its come from setPerformance.
   the errorLog's pagePath is wrong,it's shown the error created in pageA,but the error acutally created in pageB.
   
   先打开A页面,在进入B页面,并在B页面触发一个错误。网络里显示发送了三条请求,两条是perfData,一条是errorLog.
   perfData的pagePath是正常的,一条是进入A页面的记录,一条是进入B页面的记录,我认识是router.beforeEach中的setPerformance方法产生的。
   而errorLog产生的记录错误,它显示错误来自A页面,而错误实际是在B页面触发的,我认为是register方法的pagePath没有更新。
   
   ### What you expected to happen
   
   I want all metrics in browser panal display normally. the error's pagepath is pageB.
   
   ### How to reproduce
   
   Environment: Vue 2.6.10  Skywalking9.0.0 Skywalking-client-js0.8
   ---------------
   in permission.js, I have this code:
   import Vue from 'vue'
   import ClientMonitor from 'skywalking-client-js';
   router.beforeEach(async(to, from, next) => {
     ClientMonitor.setPerformance({
       collector: `${process.env.VUE_APP_BASE_API}/skywalkingHandler`,
       service: 'owind-web',
       pagePath: to.path,
       enableSPA: true,
       vue: Vue,
       useFmp: true,
       serviceVersion: 'v1.0.0'
     });
     versionControl.isNewVersion()
     next();
   })
   ----------------
   in main.js, I have this code:
   import ClientMonitor from 'skywalking-client-js';
   ClientMonitor.register({
     collector: `${process.env.VUE_APP_BASE_API}/skywalkingHandler`,
     service: 'owind-web',
     pagePath: location.href.substring(location.href.lastIndexOf('#') + 1),
     autoTracePerf: true,
     // enableSPA: true,
     vue: Vue,
     useFmp: true,
     serviceVersion: 'v1.0.0'
   });
   -----------------
   
   ### Anything else
   
   I also want know is my usage correct?on SPA,if I use setPerformance,do I still need register?
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] wu-sheng commented on issue #8876: [Bug] skywalking-client-js reporting error unnormal on SPA

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #8876:
URL: https://github.com/apache/skywalking/issues/8876#issuecomment-1098794480

   Open-source community can't afford to explain the codes, I am afraid. 
   
   It is better you could read codes and debug, or provide a demo app to reproduce the error. Otherwise, we could do guessing only


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] SiuChau commented on issue #8876: [Bug] skywalking-client-js reporting error unnormal on SPA

Posted by GitBox <gi...@apache.org>.
SiuChau commented on issue #8876:
URL: https://github.com/apache/skywalking/issues/8876#issuecomment-1100634549

   @Fine0830 if u need more infomation please let me know


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] SiuChau commented on issue #8876: [Bug] skywalking-client-js reporting error unnormal on SPA

Posted by GitBox <gi...@apache.org>.
SiuChau commented on issue #8876:
URL: https://github.com/apache/skywalking/issues/8876#issuecomment-1098780931

   > sorry,I still dont know why is it happend,and how to fix it. if anyone could show me how to use it correct,Im willing to discuss and submit a pr. 我是愿意提交修复的,不过我是后端开发,没怎么写过前端代码,现在也不确定问题出在哪里,是不是我用法错了。
   我看了一下client-js的源码,register方法会调用segments  handleerrors  perfData。但是我不太理解前端是怎么监控错误产生的,以及为什么传入handleerror的pagePath不会更新。
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] wu-sheng closed issue #8876: [Bug] skywalking-client-js reporting error unnormal on SPA

Posted by GitBox <gi...@apache.org>.
wu-sheng closed issue #8876: [Bug] skywalking-client-js reporting error unnormal on SPA
URL: https://github.com/apache/skywalking/issues/8876


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] SiuChau commented on issue #8876: [Bug] skywalking-client-js reporting error unnormal on SPA

Posted by GitBox <gi...@apache.org>.
SiuChau commented on issue #8876:
URL: https://github.com/apache/skywalking/issues/8876#issuecomment-1098804606

   那我可能无法提供pr,但我仍认为这是一个BUG,复现的环境和代码我贴在了How to reproduce,希望能得到帮助


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] wu-sheng commented on issue #8876: [Bug] skywalking-client-js reporting error unnormal on SPA

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #8876:
URL: https://github.com/apache/skywalking/issues/8876#issuecomment-1098806546

   Please update all your comments into English to dual languages, otherwise, ppl in other countries can't follow what happens.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] wu-sheng commented on issue #8876: [Bug] skywalking-client-js reporting error unnormal on SPA

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #8876:
URL: https://github.com/apache/skywalking/issues/8876#issuecomment-1098764092

   @SiuChau Are you going to fix this? You checked `Yes I am willing to submit a PR!`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org