Skip to content
Discussion options

You must be logged in to vote

The errors are happening because:

  1. api.runAsyncOnBackendWithManualTransactionHandling() expects an async function with manual transaction handling, but your function is synchronous—so Trilium suggests using api.runOnBackend() instead.
  2. The destructuring error (Cannot destructure property 'becca' of 'undefined') happens because the backend function you pass to api.runOnBackend() or api.runAsyncOnBackendWithManualTransactionHandling() does not receive any parameters by default. You should access backend APIs (like api.getNote, api.createTextNote) directly via the provided api object, not by destructuring becca from parameters.

Here’s a corrected script that creates or opens today’s note di…

Replies: 0 comments 10 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
8 replies
@SpaceRaceMouse
Comment options

@dosubot
Comment options

@SpaceRaceMouse
Comment options

@dosubot
Comment options

Answer selected by SpaceRaceMouse
@SpaceRaceMouse
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
1 participant