svelte-editorjs
svelte-editorjs copied to clipboard
How to add tools?
I am trying to add tools to editorjs following their docs.
i added the tools in createEditor but I get this error.

any idea why this is happening? thanks!
Hi! Do you maybe have a CodeSandbox (or a small repo) where I can see what you're trying to do?
hello I tried doing it on codesandbox... and it works fine.
I think it's because I am using sapper for my project and it defaults to be compatible with ssr? Guess I need to figure out how to do that.
I am aware editorjs fails on SSR so you need to dynamically import it on the client. But I am doing that in this package by default: https://github.com/pablo-abc/svelte-editorjs/blob/44871bb108c5979adf99824ba43ff11410444ae5/src/index.ts#L56-L57
Maybe there's something else I'm missing? I haven't used Sapper in a while. Do you have a repo I could use to check this locally?
There is no problem with your package on its own. What I'm having trouble with is adding the "tools" that adds more options to the editor.
I will make a small repo when I try your project again! looks cool!
Ah. That might be an oversight on my part eventually as well. I guess this means tool packages also require window or document. This means that I should allow for asynchronous loading of these as well within this package. When I get some free time I'll get around to checking how I could do this.
Thanks a lot for your interest!
i would love to be able to use all of the tools out of the box.
running into the same issue when trying to add tools...
...dunno if you are still maintaining this action, but it would be great if all the tools worked out of the box :-) At least the ones that support ESM
did this get resolved ?