[Feature request] Error Tracking #4033

Open
opened 2025-10-01 16:35:48 -05:00 by giteasync · 5 comments
Owner

Originally created by @mkg20001 on GitHub.

There should be a way to track script errors

Possibly some kind of UI to access data from a newly introduced table that would contain the stacktraces of the errors (with file-urls replaced by trilium links)

Originally created by @mkg20001 on GitHub. There should be a way to track script errors Possibly some kind of UI to access data from a newly introduced table that would contain the stacktraces of the errors (with file-urls replaced by trilium links)
Author
Owner

@zadam commented on GitHub:

@twh270 You need to keep in mind that both electron and the web app are fundamentally two separate processes - one frontend (browser) and one backend (server). When you run console.log() or alert() on the backend (script), you can't expect results on the frontend. alert() does not make sense on the backend process, console.log works but you will need to watch the backend process stdout.

For backend scripts I recommend using api.log('message'); which will print it to stdout like console.log but also log it which will make it available in Top left menu -> Show backend logs dialog.

Setting breakpoints for scripts is not possible.

@zadam commented on GitHub: @twh270 You need to keep in mind that both electron and the web app are fundamentally two separate processes - one frontend (browser) and one backend (server). When you run console.log() or alert() on the backend (script), you can't expect results on the frontend. `alert()` does not make sense on the backend process, `console.log` works but you will need to watch the backend process stdout. For backend scripts I recommend using `api.log('message');` which will print it to stdout like console.log but also log it which will make it available in Top left menu -> Show backend logs dialog. Setting breakpoints for scripts is not possible.
Author
Owner

@dosubot[bot] commented on GitHub:

Hi, @mkg20001. I'm Dosu, and I'm helping the Trilium team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • You proposed a feature for error tracking in Trilium, suggesting a UI for error stack traces.
  • The feature aims to replace file URLs with Trilium links for better integration, inspired by sentry.io.
  • @zadam noted current limitations, with frontend errors viewable in the console and backend errors in the Trilium log.
  • @twh270 asked about debugging techniques, and @zadam provided guidance on backend logging and process separation.

Next Steps:

  • Please let us know if this issue is still relevant to the latest version of the Trilium repository by commenting here.
  • If there is no further input, this issue will be automatically closed in 7 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub: Hi, @mkg20001. I'm [Dosu](https://dosu.dev), and I'm helping the Trilium team manage their backlog. I'm marking this issue as stale. **Issue Summary:** - You proposed a feature for error tracking in Trilium, suggesting a UI for error stack traces. - The feature aims to replace file URLs with Trilium links for better integration, inspired by sentry.io. - @zadam noted current limitations, with frontend errors viewable in the console and backend errors in the Trilium log. - @twh270 asked about debugging techniques, and @zadam provided guidance on backend logging and process separation. **Next Steps:** - Please let us know if this issue is still relevant to the latest version of the Trilium repository by commenting here. - If there is no further input, this issue will be automatically closed in 7 days. Thank you for your understanding and contribution!
Author
Owner

@twh270 commented on GitHub:

What are some techniques to debug scripts? Console.log() does nothing, nor does alert(), and I don't even know where to go to set a breakpoint -- introducing a syntax error into the "attribute changed" JS seems to just cause it to abort.

@twh270 commented on GitHub: What are some techniques to debug scripts? Console.log() does nothing, nor does alert(), and I don't even know where to go to set a breakpoint -- introducing a syntax error into the "attribute changed" JS seems to just cause it to abort.
Author
Owner

@zadam commented on GitHub:

So frontend scripts errors can be seen in either browser or electron console (ctrl-shift-i) and backend script errors in the trilium log. But yeah, it kind of sucks and the stack traces are often not very useful.

@zadam commented on GitHub: So frontend scripts errors can be seen in either browser or electron console (ctrl-shift-i) and backend script errors in the trilium log. But yeah, it kind of sucks and the stack traces are often not very useful.
Author
Owner

@mkg20001 commented on GitHub:

You could take inspiration from sentry.io

@mkg20001 commented on GitHub: You could take inspiration from sentry.io
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TriliumNext/Trilium#4033
No description provided.