I'm trying to integrate editorjs (https://editorjs.io/) in my project then I downloaded the editor.js to my project and loaded it in my html page:
<script src='lib/editor.js'></script>
And I added:
<script src='lib/myeditorloader.js'></script>
Which contains:
import EditorJS from '@editorjs/editorjs';
const editor = new EditorJS('editorjs');
I got that error:
Uncaught SyntaxError: Cannot use import statement outside a module
I added type='module' to get and as thing are never simple with js, I got this error:
Uncaught TypeError: Failed to resolve module specifier "@editorjs/editorjs".
Relative references must start with either "/", "./", or "../".
I tried import EditorJS from './editor.js'; but now I get:
Uncaught SyntaxError: The requested module './editor.js' does not provide an export named 'default'
Is editojs buggy or what ?
<script src="https://cdn.jsdelivr.net/npm/@editorjs/editorjs@latest"></script>instead of making it difficult using node modules for html directly which will require bundler, parser, babel, lot more