vue.draggable.next
vue.draggable.next copied to clipboard
Rendered exceptions and error logging in production
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.
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.