I’m mostly working off of code examples and trying to understand the various libraries. If I am asking this question in the wrong place, I would appreciate being redirected. I have a codesandbox demo here.
My end goal is to develop a collaborative editor with annotations working off of the demo by Hans Pagel.
Generally, it works. However, you’ll see a few errors.
- “Cannot read properties of null (reading ‘matchesNode’)” error that happens on load - I’m struggling to debug this issue and I’m hoping someone might have some insight.
- In the codesandbox console, you’ll see a “binding error” message. This is coming from the createDecorations function in the extension file AnnotationState file. When I tried to use Hans’ code, without changes, it would sometimes break because the ySyncPluginKey binding value is undefined or null which led to no decorations being loaded at start… somehow I added something that is now making the annotations load at start, but I have no idea how. Previously, I had to add one new annotation then the old ones would start showing up. I’m currently using localStorage to simulate saving and loading yjs data.
Any help would be greatly appreciated.