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

Editor misbehaves after entering link #1427

Closed wwwald closed 3 years ago

wwwald commented 3 years ago

Running Trilium 0.45.4 on Windows 10.

Quite regularly, I notice that the editor becomes partly unresponsive and does not save entered text anymore, usually right after entering an internal link by typing @. I need to refresh Trilium (Ctrl+Shift+R) to get it working normally again.

The JS Console shows these exceptions:

VM426:5 Uncaught TypeError: Cannot read property 'getStyle' of null
    at Ra.e.on.priority (<anonymous>:5:584643)
    at Ra.fire (<anonymous>:5:128716)
    at Ra._convertItem (<anonymous>:5:309526)
    at Ra.convert (<anonymous>:5:308803)
    at Object.callback (<anonymous>:5:314982)
    at Fl._runPendingChanges (<anonymous>:5:374823)
    at Fl.change (<anonymous>:5:371614)
    at Va.toModel (<anonymous>:5:314950)
    at Cm._handleContainerChildrenMutations (<anonymous>:5:535614)
    at Cm.handle (<anonymous>:5:535086)
glob.js:60 Uncaught TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'ol'
    |     property 'model' -> object with constructor 'Fl'
    --- property '_currentWriter' closes the circle
    at JSON.stringify (<anonymous>)
    at window.onerror (glob.js:60)

Any clue what could be causing this?

zadam commented 3 years ago

Hello, I noticed this as well. I think it's a CKEditor bug, although I can't say that with certainty ...

wwwald commented 3 years ago

Well, there is issue ckeditor/ckeditor5#4959 on circular references and JSON.stringify... but it's been open since 2017.

Do you think that this is the same problem we're seeing here?

WKSu commented 3 years ago

triliumerror

Adding another example of CKeditor not handling URLs very well! Seems to be a similar symptom but not sure if the root cause is the same. (It won't save a document if I try to enter additional info to a previous bullet point after I add a link - but it does work if I add information in an unrelated field).

Looking up the error codes result in https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-model-nodelist-offset-out-of-bounds and https://ckeditor.com/docs/ckeditor5/latest/framework/guides/tutorials/implementing-an-inline-widget.html#fixing-position-mapping

Unfortunately I am not entirely familiar if this issue can be fixed in Trilium or if I should open a new issue over at CKEditor, but hope this helps a bit!

For anyone else suffering from the same issue, using ctrl + k to enter links is also a possibility (and possibly cleaner). :)

Trilium 0.45.7 Linux Server.

martinkoutecky commented 3 years ago

Hi, I'm suffering from this too. For me the error seems to me Uncaught CKEditorError: t.viewItem.parent is nulland refers to https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-t.viewItem.parent. But I have also experienced the model-nodelist-offset-out-of-bounds error mentioned by @WKSu. Seems to happen to me both in Firefox (server edition) and in the desktop edition.

wwwald commented 3 years ago

I don't see this erratic behavior anymore with the new 0.48 version.

The 0.48 release notes mention that CKEditor was updated to version 30 - I'm guessing that that has solved the problem above.

Time to close the issue?

zadam commented 3 years ago

Thanks for confirmation, closing.