I developed a Vite plugin that collects web runtime information during local development. When a runtime error occurs, the plugin writes the error details to the node_modules/.cache/<vite-plugin>/error.log file.
The content of the error.log file is like:
{“time”:1754981837203,“error”:{“name”:“Error”,“message”:“foo”,“stack”:“Error: foo\n at foo (http://localhost:5173/src/App.vue?t=1754981834230:8:13)\n at callWithErrorHandling (http://localhost:5173/node_modules/.vite/deps/vue.js?v=3b684f73:2289:19)\n at callWithAsyncErrorHandling (http://localhost:5173/node_modules/.vite/deps/vue.js?v=3b684f73:2296:17)\n at HTMLButtonElement.invoker (http://localhost:5173/node_modules/.vite/deps/vue.js?v=3b684f73:11296:5)”}}
{“time”:1754982033761,“error”:{“name”:“Error”,“message”:“Hello from bar function!”,“stack”:“Error: Hello from bar function!\n at bar (http://localhost:5173/src/App.vue?t=1754982030686:11:13)\n at callWithErrorHandling (http://localhost:5173/node_modules/.vite/deps/vue.js?v=3b684f73:2289:19)\n at callWithAsyncErrorHandling (http://localhost:5173/node_modules/.vite/deps/vue.js?v=3b684f73:2296:17)\n at HTMLButtonElement.invoker (http://localhost:5173/node_modules/.vite/deps/vue.js?v=3b684f73:11296:5)”}}
Based on above collected error info, I want to know: is it possible for Cursor Agent to automatically read this file, analyze the issue, and fix it after the error is written? If so, how can I achieve this?