0

So I've been trying to work with PaperJS for a short while now and what I notice is that the error messages only refer back to lines in the library code where it eventually goes wrong. It never tells me though where in my own code the problem originated. This makes debugging nearly impossible sometimes and currently I'm stuck. Is there any way to set it such that I can actually trace where it goes wrong in my code? An example error is provided below. Also on a separate note, if someone could explain how addChild can trigger the error item._remove is not a function, that'd be greatly appreciated.

TypeError: item._remove is not a function[Learn More] paper-full.js:4018:6
    insertChildren http://localhost:3000/scripts/paper-full.js:4018
    insertChild http://localhost:3000/scripts/paper-full.js:3999
    addChild http://localhost:3000/scripts/paper-full.js:3995
    onMouseUp http://localhost:3000/scripts/paper-full.js line 16889 > Function:282
    emit http://localhost:3000/scripts/paper-full.js:675
    emit http://localhost:3000/scripts/paper-full.js:13613
    _handleMouseEvent http://localhost:3000/scripts/paper-full.js:13623
    _handleMouseEvent http://localhost:3000/scripts/paper-full.js:13067
    mouseup http://localhost:3000/scripts/paper-full.js:12892
Omnia87
  • 103
  • 7
  • 2
    You can use the stack trace in the debug tools from Chrome and Firefox ; you can also stop when an uncaught exception occurs. This will help you go back to your error. Note that you can also use `http://sketch.paperjs.org/` to share you code here so we can help you. – arthur.sw Apr 03 '19 at 08:49
  • Can we try to deal with this problem without me revealing code? I'm not writing open source. I'm just wondering if there's a plugin or a configuration of sorts that just provides the linenumber with the exception. I have no clue how the stack trace is going to help me understand what is causing the error, specifically because those environments you mention only show those if I add the 'debugger;' line on a very specific point, and it just so happens that I don't know where to put it because of not knowing where the error is caused. – Omnia87 Apr 03 '19 at 13:34
  • 1
    You should probably be able to extract the small piece of code which reproduces your error, and this is very unlikely to be unique. [Here](https://stackoverflow.com/questions/29263440/how-to-turn-on-pause-on-uncaught-exceptions-in-google-chrome-canary) is a screenshot of the button you need to pause on errors. You can also you breakpoints. – arthur.sw Apr 03 '19 at 13:59

0 Answers0