Closed SomeMinecraftModder closed 2 years ago
I was able to solve it with:
import type Editor from '@toast-ui/editor';
let editor: Editor;
let el: HTMLDivElement;
onMount(async () => {
const tui = await import('@toast-ui/editor');
editor = new tui.Editor({
el,
height: '20rem',
initialEditType: 'wysiwyg',
previewStyle: 'vertical',
usageStatistics: false
});
});
The trick is to:
Thanks you, it worked !
Describe the bug
When using the Editor in SvelteKit, it error out with
But when I comment the import line and the Editor creation line (the
const editor = new Editor
), for some reason it work until I change some code, then it error out with the same error as above.Here is my code
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would like that if it would not error out.
Desktop (please complete the following information):
Additional context
Looks like it's hmr (hot module reload) that doesn't play well with the Editor.