-
Notifications
You must be signed in to change notification settings - Fork 4
RangeError: Adding different instances of a keyed plugin (plugin$1) #2
Comments
I think that's caused by multiple versions of prosemirror libraries being imported. When using Webpack to build you can set aliases to fix this problem:
But I haven't had any luck fixing this when using Rollup (which is what the default svelte template uses). To get around this for the time being you may have to use the Svelte Webpack template and set up aliases as above. If you really want to use Rollup you can hack around this problem by renaming all plugins in Editor.js, starting around line 198:
|
Well, I definitely want it to work with Rollup without hacking around the source code. But I did not install multiple version of prosemirror. I also tried soft-linking everything in |
I added Then I added another
It seems that 1-4 have duplicated key to 5-8. BTW, if I comment out all the extensions in |
It's not due to anything you've installed, it's something to do with the way Svelte/Rollup pulls in dependencies (including the prosemirror libraries which are used in tiptap-svelte, tiptap-svelte-extensions etc). It looks like you can get things to work by adding the prosemirror libraries as devDependencies to your editor project:
And then changing the dedupe option in rollup.config.js to look like this:
I'm not sure whether this is a great way to do things but it seems to work. |
Well, I guess I got you. |
I created my editor based on the svelte template .
I copied the content of
tiptap-svelte-example/src/route/read-only/index.svelte
(and modified the paths for the import) to the App.svelte.MyEditor.zip
To simplify the reproduce-process, just download the attachment and extract it into this repo directory (make
MyEditor
a sibling totiptap-svelte-examples
)After
npm install && npm run dev
, you will see this error in your browser console.The text was updated successfully, but these errors were encountered: