react-froala-wysiwyg icon indicating copy to clipboard operation
react-froala-wysiwyg copied to clipboard

How to use codemirror 6 with froala?

Open goodpilotfish opened this issue 1 year ago • 0 comments

When integrating Codemirror I found a few old issues that were helpful. Ended up with this code:

import CodeMirror from "codemirror";
import 'codemirror/lib/codemirror.css';
import 'codemirror/mode/xml/xml.js';

<FroalaEditorComponent
          tag="textarea"
          config={
            codeMirror: CodeMirror,
            ...
          }
        />

This works when I lock codemirror to v5 "codemirror": "^5",

When I use the new codemirror I get the following errors

SyntaxError: The requested module '/node_modules/.vite/deps/codemirror.js?v=c62307cd' does not provide an export named 'default' (at froalaConfig.ts:11:8)

✘ [ERROR] Missing "./lib/codemirror.css" specifier in "codemirror" package [plugin vite:dep-scan]
✘ [ERROR] Missing "./mode/xml/xml.js" specifier in "codemirror" package [plugin vite:dep-scan]

How can I correctly import v6 into Froala?

goodpilotfish avatar May 18 '23 10:05 goodpilotfish