Open arvindpdmn opened 6 years ago
I removed the require
and export
from . My code is now:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/codemirror.spell-checker/latest/spell-checker.min.css">
<script src="https://cdn.jsdelivr.net/npm/typo-js@1.0.3/typo.min.js"></script>
<script src={localpath}/js/spell-checker.min.js"></script>
<script src="https://codemirror.net/addon/mode/overlay.js"></script>
No errors this time but spell check is not happening. In CodeMirror, textarea content is actually within <div class="CodeMirror-code" role="presentation>"
. Nothing happens when spell checker is invoked this way:
CodeMirrorSpellChecker({
codeMirrorInstance: CodeMirror,
});
CodeMirror.fromTextArea(jQuery(".CodeMirror-code")[0], {
mode: "spell-checker"
});
This is what I have in
<head>
:This fails with error
ReferenceError: require is not defined
due to an attempt to requiretypo-js
. What I understand is thatrequire
will work within Node.js runtime but not in browser. What's the solution?