zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
27.2k stars 1.9k forks source link

Somehow canvas notes don't work anymore #3195

Closed deajan closed 1 year ago

deajan commented 2 years ago

Trilium Version

0.55.1

What operating system are you using?

Windows

What is your setup?

Local (no sync)

Operating System Version

Windows 10 21H2 x64

Description

Testing trilium as replacement for logseq since a couple of hours. I've tried to make a canvas scheme, and the canvas began behaving strangely (letters disappeared once they were typed etc). I ended up not being able to modify the canvas, the mouse won't select anything in it. Everytime I double click, I get the following error in console:


DB size: 2707 KB
Trusted reverse proxy: false
App HTTP server starting up at port 37840
{
  "appVersion": "0.55.1",
  "dbVersion": 197,
  "syncVersion": 26,
  "buildDate": "2022-09-21T22:43:34+02:00",
  "buildRevision": "180051d252d254a2543f8192a28e87e134594a38",
  "dataDirectory": "C:\\Users\\MyUser\\AppData\\Roaming\\trilium-data",
  "clipperProtocolVersion": "1.0",
  "utcDateTime": "2022-10-13T12:34:36.758Z"
}
CPU model: AMD Ryzen 7 1800X Eight-Core Processor         , logical cores: 16 freq: 3593 Mhz
Listening on port 37840
Becca (note cache) load took 6ms
Registered global shortcut Ctrl+Alt+P for action createNoteIntoInbox
Generated CSRF token PWSWF5IX-NZzZXb5jl3jU_zTH-mNmFsQnZKI with secret _csrf=IBe8GQxkzKCp54za3OhbUpCd; Path=/
200 GET /api/options with 5744 bytes took 1ms
200 GET /api/tree with 13903 bytes took 1ms
200 GET /api/keyboard-actions with 11944 bytes took 1ms
200 GET /api/keyboard-shortcuts-for-notes with 2 bytes took 1ms
200 GET /api/script/widgets with 2717 bytes took 1ms
200 POST /api/tree/load with 4413 bytes took 1ms
websocket client connected
200 POST /api/tree/load with 1952 bytes took 1ms
200 GET /api/search/%23bookmarked%20or%20%23bookmarkFolder with 31 bytes took 1ms
200 POST /api/tree/load with 7784 bytes took 0ms
200 GET /api/notes/VwuOo1w4IYtf/backlink-count with 11 bytes took 1ms
200 GET /api/notes/VwuOo1w4IYtf with 217473 bytes took 2ms
200 GET /api/script/startup with 2231 bytes took 1ms
200 POST /api/tree/load with 4851 bytes took 1ms
200 POST /api/tree/load with 6109 bytes took 0ms
Table counts: notes: 183, note_revisions: 9, branches: 201, attributes: 270, etapi_tokens: 0
All consistency checks passed with no errors detected (took 15ms)
JS Error: Uncaught error: Message: Uncaught TypeError: Cannot read properties of null (reading 'getNonDeletedElements'), URL: http://127.0.0.1:37840/#root/VwuOo1w4IYtf-XyAi, Line: 56, Column: 339, Error object: {}, Stack: TypeError: Cannot read properties of null (reading 'getNonDeletedElements')
    at O (<anonymous>:2:636728)
    at w (<anonymous>:2:635694)
    at Object.perform (<anonymous>:2:311757)
    at e.value (<anonymous>:2:359604)
    at f.Mo.handleLinearElementOnPointerDown (<anonymous>:2:509561)
    at Mo.handleCanvasPointerDown (<anonymous>:2:501329)
    at Object.vi (<anonymous>:202:330)
    at ui (<anonymous>:32:27)
    at xi (<anonymous>:32:81)
    at zg (<anonymous>:55:403)
Stack: Error
    at Object.C [as logError] (http://127.0.0.1:37840/app-dist/desktop.js:2:102014)
    at Gn.window.onerror (http://127.0.0.1:37840/app-dist/desktop.js:2:541612)
JS Error: Uncaught error: Message: Uncaught TypeError: Cannot read properties of null (reading 'getNonDeletedElements'), URL: http://127.0.0.1:37840/#root/VwuOo1w4IYtf-XyAi, Line: 56, Column: 339, Error object: {}, Stack: TypeError: Cannot read properties of null (reading 'getNonDeletedElements')
    at O (<anonymous>:2:636728)
    at w (<anonymous>:2:635694)
    at Object.perform (<anonymous>:2:311757)
    at e.value (<anonymous>:2:359604)
    at f.Mo.handleLinearElementOnPointerDown (<anonymous>:2:509561)
    at Mo.handleCanvasPointerDown (<anonymous>:2:501329)
    at Object.vi (<anonymous>:202:330)
    at ui (<anonymous>:32:27)
    at xi (<anonymous>:32:81)
    at zg (<anonymous>:55:403)
Stack: Error
    at Object.C [as logError] (http://127.0.0.1:37840/app-dist/desktop.js:2:102014)
    at Gn.window.onerror (http://127.0.0.1:37840/app-dist/desktop.js:2:541612)
JS Error: Uncaught error: Message: Uncaught TypeError: Cannot read properties of null (reading 'getNonDeletedElements'), URL: http://127.0.0.1:37840/#root/VwuOo1w4IYtf-XyAi, Line: 56, Column: 339, Error object: {}, Stack: TypeError: Cannot read properties of null (reading 'getNonDeletedElements')
    at O (<anonymous>:2:636728)
    at w (<anonymous>:2:635694)
    at Object.perform (<anonymous>:2:311757)
    at e.value (<anonymous>:2:359604)
    at f.Mo.handleLinearElementOnPointerDown (<anonymous>:2:509561)
    at Mo.handleCanvasPointerDown (<anonymous>:2:501329)
    at Object.vi (<anonymous>:202:330)
    at ui (<anonymous>:32:27)
    at xi (<anonymous>:32:81)
    at zg (<anonymous>:55:403)
Stack: Error
    at Object.C [as logError] (http://127.0.0.1:37840/app-dist/desktop.js:2:102014)
    at Gn.window.onerror (http://127.0.0.1:37840/app-dist/desktop.js:2:541612)

In the canvas note, I cannot even select a tool to add text or an arrow. I cannot even use the export to disk / png button. Of course I can open a new canvas and everything works as expected.

I tried to save the canvas (export as json and reimport in a fresh Trilium instance, changing its type to canvas), the issue stays the same. I've also uploaded the exported canvas JSON to a validator which says everything is okay.

I'd like to recover the canvas (more for a proof of concept I don't lose data than for the actual contents which are about 10 minutes of work). Provided the export canvas json file as attachment to this issue.

Best regards. schema_reseau.zip

zadam commented 2 years ago

Hello, I can reproduce the problem. I extracted the file: schema_reseau.txt

When I try to import into the excalidraw using the button:

image

Then it works fine. Trilium also saves application state together with the diagram, it's possible that something is broken there. I will continue with the investigation tomorrow.