Closed Schidster closed 4 years ago
I tried sapper-template#webpack too. Same case. Same error.
Sorry the problem was with me. As Sapper uses ssr, importing it in server side caused problems like these. I instead used dynamic imports like below as recomended in the official documentation.
<script>
import { onMount } from 'svelte';
onMount(async () => {
const editorjs = await import ('@editorjs/editorjs');
const EditorJs = editorjs.default;
let editor = new EditorJs({
/* ...configurations */
});
/* ...rest of the stuff */
</script>
Hope this would be helpful for anyone using editorjs in ssr environment. I am closing this issue.
How did you go about getting the tool plugins to work? I followed your implementation.
<script> import { onMount } from 'svelte' onMount(async () => { const editorjs = await import('@editorjs/editorjs') const Header = await import('@editorjs/header') const List = await import('@editorjs/list') const EditorJs = editorjs.default let editor = new EditorJs({ holder: 'editorjs', tools: { header: { class: Header, inlineToolbar: ['link'], }, list: { class: List, inlineToolbar: true, }, }, }) }) </script>
I receive an error in my console that says the following.
Would you mind sharing your implementation of tools?
Sorry man. Its been a year since I touched programming, I dont remember anything about it. I was a naive programmer then, if I figured it out, u too can. All the best with your project. Bye :)
On Fri, Feb 26, 2021, 7:04 PM Dan Sivewright notifications@github.com wrote:
How did you go about getting the tool plugins to work? I followed your implementation.
I receive an error in my console that says the following. [image: Screenshot 2021-02-26 at 15 34 06] https://user-images.githubusercontent.com/61431543/109306613-1463df00-7848-11eb-88f3-c79afc935c1e.png
Would you mind sharing your implementation of tools?
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/codex-team/editor.js/issues/1142#issuecomment-786651054, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANQPMDQZSKDHDERHNFVRNK3TA6PQBANCNFSM4MYE5DSA .
@DanSivewright If you still have that problem, you can follow my example
Description
Importing EditorJs from '@editorjs/editorjs' after installing npm package results development server crash. It also sometimes said that maximum call stack exceeded. Also tried building the project and serving with node. That to failed. However it works with standalone svelte project.
Steps to reproduce:
Run the following commands.
Now add the following to ~/my-app/src/routes/index.svelte in the top.
...rest of the stuff.
Editor.js version: