0

my purpose to create a collaborative editor with Monaco editor and Convergence. I'm following these repo and example:

https://github.com/convergencelabs/monaco-collab-ext https://github.com/convergencelabs/javascript-examples/blob/master/src/examples/monaco/monaco-adapter.js

I just import this module

import MonacoCollabExt from '@convergencelabs/monaco-collab-ext';

Then I try to create a new object from a class of this module

        const contentManger = new MonacoCollabExt.EditorContentManager({
          editor: editor,
          onInsert(index, text) {
            _model.insert(index, text);
          },
          remoteSourceId: 'convergence',
        });

But I got an error "Cannot read property 'EditorContentManager' of undefined" Seem like MonacoCollabExt is undefined, but I already install it as dependencies and imported it. What is wrong? Thanks!

dungreact
  • 442
  • 1
  • 9
  • 22

1 Answers1

1

I found the solution. I used

import { EditorContentManager } from '@convergencelabs/monaco-collab-ext';

Then it's work!

dungreact
  • 442
  • 1
  • 9
  • 22