editor.js
editor.js copied to clipboard
Why can't import BlockAddedMutationType
When you use
import EditorJS, {BlockAddedMutationType} from '@editorjs/editorjs';
You will get this error:
SyntaxError: The requested module '/node_modules/.vite/deps/@editorjs_editorjs.js?v=03c9909b' does not provide an export named 'BlockAddedMutationType' (at Editor.vue:7:1)
But in VSCode, ctrl+click could jump to export file, and shows BlockAddedMutationType exported
And after tries, I found this works:
import EditorJS, {type OutputData} from '@editorjs/editorjs';
So, what magic behind this ? editorjs hope we use it or otherwise?