I am developing a Laravel/Vuejs(3) app. For error capturing it was decided to use Sentry. The problem is some of the errors in Sentry log are very unfriendly and have no usable stack trace for debugging. Also these “unfriendly” errors are showing only in production environment. Source maps are uploaded correctly.
I tried to reproduce example of such error in console (same in Sentry log) when I am trying to pass empty and incorrect type required property to component.
<search :test=“”…
In development (local) env app doesn’t crash and only show warnings:
[Vue warn]: Template compilation error: v-bind is missing expression. 1386| :test=""
[Vue warn]: Missing required prop: "test"
at <Search…
[Vue warn]: Invalid prop: type check failed for prop "test". Expected Object, got String with value "".
at <Search
All stack traces are usable and go straight to the needed lines in code.
In production env app crashes:
Uncaught SyntaxError: 34 (at app.js?id=79c2a9c9566c92c78209124eb01cbfb4:2:150910)
With no trace to component name whatsoever.
I suspect the reason for that is Vue production build drops chunks of code for smaller payload size and better performance and there are no options for changing that, am I right?
As data passed to properties is dynamic and differs in development/production environment, so it’s not possible to test everything before releasing, how do you cope with debugging such hardly-traceable errors then?