vue.draggable.next icon indicating copy to clipboard operation
vue.draggable.next copied to clipboard

Rendered exceptions and error logging in production

Open J-T-McC opened this issue 2 years ago • 1 comments

Test link

Test Link

Step by step scenario

  • create a new draggable instance
  • create a custom method that throws an arbitrary error
  • via a slot, {{ callCustomMethod() }} to cause the error

Actual Solution

Any errors during render cause the component to render the error stack trace and does not log the error.

Expected Solution

Any errors cause the error to bubble and the error is logged.


I recently migrated a vue2 draggable to vue3. I had a case where an error was introduced into production but it was not visible in my error tracking service. A user submitted an error report including a screenshot of a stack trace pointing to chunked vendor files. After some digging I discovered the cause of the issue was a method that was being used in a slot to render some dynamic content in a sortable list.

I notice the vue3 version of draggable has a try/catch in its render function that renders the stack trace for any error, while the vue2 version does not.

I think it would be a nice improvement to add a custom error handler option to manage these render errors. Or have the ability to allow the error to bubble rather than rendering the stack trace.

I don't mind submitting a PR for this if its something you are interested in.

J-T-McC avatar Jul 29 '22 20:07 J-T-McC

This prevents debugging this component usage, I think. Letting the error bubble would be more efficient or just trow error message that could hint how to use this drag component.

Kwaadpepper avatar Sep 14 '22 14:09 Kwaadpepper