You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the CodeMirror 6 instance is not mounted in Vue3(Nuxt, in my case), there are problems with synchronisations. When an instance is running with some text and a new instance is created in another browser tab, there is no synchronisation and there are errors in the console. Errors in the console:
To Reproduce
Steps to reproduce the behavior:
Create a sample Nuxt3 project.
Replace the index.vue with the code bellow, and install libraries as needed:
Expected behavior state should be able to be created without being inside mounted. I have never needed to create state inside mounted before, and there is nothing in the documentation that indicates this should be the case, therefore I believe this is an issue.
Screenshots
Given above.
Environment Information
Chromium / Edge
Yjs latest version.
The text was updated successfully, but these errors were encountered:
Usually, the state of CodeMirror plugins is stateless. That's why it doesn't matter, usually, whether you define a plugin state before or after mount. The Yjs plugins, however, are stateful and depend on the view to work. While your component is mounting, the Yjs document might receive some content from a remote peer. The plugin-state changes, but the plugin cannot update the view (force the view to transition to a new state that reflects the value of the Yjs document).
I'm not sure how to fix this at the moment. Since there is an easy solution to it - initialize the state with the view, it's not a high priority right now for me. But I'll leave the ticket open and will come back to it eventually.
Checklist
Describe the bug
When the CodeMirror 6 instance is not
mounted
in Vue3(Nuxt, in my case), there are problems with synchronisations. When an instance is running with some text and a new instance is created in another browser tab, there is no synchronisation and there are errors in the console. Errors in the console:To Reproduce
Steps to reproduce the behavior:
Expected behavior
state
should be able to be created without being insidemounted
. I have never needed to createstate
insidemounted
before, and there is nothing in the documentation that indicates this should be the case, therefore I believe this is an issue.Screenshots
Given above.
Environment Information
The text was updated successfully, but these errors were encountered: