Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TipTap is not working on react with vite project. #3492

Closed
1 of 2 tasks
TroublesomeSaramsh789 opened this issue Dec 5, 2022 · 56 comments
Closed
1 of 2 tasks

TipTap is not working on react with vite project. #3492

TroublesomeSaramsh789 opened this issue Dec 5, 2022 · 56 comments
Labels
Type: Bug The issue or pullrequest is related to a bug

Comments

@TroublesomeSaramsh789
Copy link

What’s the bug you are facing?

X [ERROR] Could not resolve "prosemirror-keymap"

node_modules/@tiptap/core/dist/tiptap-core.esm.js:3:23:
  3 │ import { keymap } from 'prosemirror-keymap';     
    ╵                        ~~~~~~~~~~~~~~~~~~~~      

You can mark the path "prosemirror-keymap" as external to exclude it from the bundle, which will
remove this error.

X [ERROR] Could not resolve "prosemirror-commands"

node_modules/@tiptap/core/dist/tiptap-core.esm.js:6:567:
  6 │ ... selectTextblockEnd$1, selectTextblockStart as selectTextblockStart$1, setBlockType, wrapIn as wrapIn$1 } from 'prosemirror-commands'; 
    ╵                                                                                                                   ~~~~~~~~~~~~~~~~~~~~~~  

You can mark the path "prosemirror-commands" as external to exclude it from the bundle, which will
remove this error.

X [ERROR] Could not resolve "prosemirror-schema-list"

node_modules/@tiptap/core/dist/tiptap-core.esm.js:7:107:
  7 │ import { liftListItem as liftListItem$1, sinkListItem as sinkListItem$1, wrapInList as wrapInList$1 } from 'prosemirror-schema-list';     
    ╵                                                                                                            ~~~~~~~~~~~~~~~~~~~~~~~~~      

You can mark the path "prosemirror-schema-list" as external to exclude it from the bundle, which
will remove this error.

X [ERROR] Could not resolve "prosemirror-gapcursor"

node_modules/@tiptap/extension-gapcursor/dist/tiptap-extension-gapcursor.esm.js:2:26:
  2 │ import { gapCursor } from 'prosemirror-gapcursor';
    ╵                           ~~~~~~~~~~~~~~~~~~~~~~~

You can mark the path "prosemirror-gapcursor" as external to exclude it from the bundle, which
will remove this error.

X [ERROR] Could not resolve "prosemirror-history"

node_modules/@tiptap/extension-history/dist/tiptap-extension-history.esm.js:2:36:
  2 │ import { undo, redo, history } from 'prosemirror-history';
    ╵                                     ~~~~~~~~~~~~~~~~~~~~~

You can mark the path "prosemirror-history" as external to exclude it from the bundle, which will
remove this error.

X [ERROR] Could not resolve "prosemirror-dropcursor"

node_modules/@tiptap/extension-dropcursor/dist/tiptap-extension-dropcursor.esm.js:2:27:
  2 │ import { dropCursor } from 'prosemirror-dropcursor';
    ╵                            ~~~~~~~~~~~~~~~~~~~~~~~~

You can mark the path "prosemirror-dropcursor" as external to exclude it from the bundle, which
will remove this error.

(node:24016) UnhandledPromiseRejectionWarning: Error: Build failed with 6 errors:
node_modules/@tiptap/core/dist/tiptap-core.esm.js:3:23: ERROR: Could not resolve "prosemirror-keymap"
node_modules/@tiptap/core/dist/tiptap-core.esm.js:6:567: ERROR: Could not resolve "prosemirror-commands"
node_modules/@tiptap/core/dist/tiptap-core.esm.js:7:107: ERROR: Could not resolve "prosemirror-schema-list"
node_modules/@tiptap/extension-dropcursor/dist/tiptap-extension-dropcursor.esm.js:2:27: ERROR: Could not resolve "prosemirror-dropcursor"
node_modules/@tiptap/extension-gapcursor/dist/tiptap-extension-gapcursor.esm.js:2:26: ERROR: Could not resolve "prosemirror-gapcursor"

Which browser was this experienced in? Are any special extensions installed?

Firefox 107

How can we reproduce the bug on our side?

  1. create a vite project.
  2. yarn add @tiptap/react @tiptap/starter-kit
  3. Import these
import { useEditor, EditorContent } from '@tiptap/react';
import StarterKit from '@tiptap/starter-kit';

const Tiptap = () => {
  const editor = useEditor({
    extensions: [StarterKit],
    content: '<p>Hello World!</p>',
  });
  return <EditorContent editor={editor} />;
};

export default Tiptap;
  1. yarn dev

Can you provide a CodeSandbox?

No response

What did you expect to happen?

tip tap editor should have rendered on the webpage.

Anything to add? (optional)

No response

Did you update your dependencies?

  • Yes, I’ve updated my dependencies to use the latest version of all packages.

Are you sponsoring us?

  • Yes, I’m a sponsor. 💖
@TroublesomeSaramsh789 TroublesomeSaramsh789 added the Type: Bug The issue or pullrequest is related to a bug label Dec 5, 2022
@slax57
Copy link

slax57 commented Dec 5, 2022

We are having this exact same issue too. Seems this is specific to the version 2.0.0-beta.205, which was recently released on npm.

It comes from this commit which turned the dependencies into devDependencies + peerDependencies (which is not equivalent)

Is this change intended?

@anshubaldeep
Copy link

Don't think it is specific to just version 2.0.0-beta.205, our team is facing the same issue even with version 2.0.0-beta.199

@ctrlplusb
Copy link

Same for a Remix site. Moving required dependencies into devDependencies definitely sounds like it is the issue.

@massimopalmieri
Copy link

I'm having the same issue, switching back to 2.0.0-beta.204 doesn't solve the issue, I had to add all the prosemirror-* packages to the dependencies

@muradbu
Copy link

muradbu commented Dec 6, 2022

We're having the same issue in our monorepo with pnpm on 2.0.0-beta.202.

@numediaweb
Copy link

numediaweb commented Dec 6, 2022

Same here, had to add them temporarily to my dependencies:

yarn add prosemirror-commands prosemirror-keymap prosemirror-model prosemirror-schema-list prosemirror-state prosemirror-transform prosemirror-view prosemirror-dropcursor prosemirror-gapcursor prosemirror-history

@RomainLanz
Copy link

Same here.

I had to roll back and lock the version to 2.0.0-beta.204.

@Willian-A
Copy link

Same issue here at 2.0.0-beta.205.
My team tried to roll back to 2.0.0-beta.202 (the version that we used to use before this update) but it keeps the error.

@HannesEURESA
Copy link

Same Error here at 2.0.0-beta.205
After Roleback to 2.0.0-beta.204 The Error is gone, but new Error appears:
ERROR in ./node_modules/@tiptap/extension-dropcursor/dist/tiptap-extension-dropcursor.esm.js
ERROR in ./node_modules/@tiptap/extension-gapcursor/dist/tiptap-extension-gapcursor.esm.js
ERROR in ./node_modules/@tiptap/extension-history/dist/tiptap-extension-history.esm.js

@Haraldson
Copy link

Haraldson commented Dec 6, 2022

I’m not sure how the sub-versioning of the 2.0.0-beta version is supposed to be interpreted, what I know is that moving from 202 to 205 certainly doesn’t feel like it should be breaking like this.

@janthurau
Copy link
Collaborator

janthurau commented Dec 6, 2022

hey all 👋 all prosemirror* and yjs* packages have been moved to peerDependencies (and devDependencies, for extension development), to avoid issues that occur if multiple versions of prosemirror* or yjs* are included in a project (e.g. because a project includes both yjs and prosemirror). Without peerDependencies, it's possible that two different versions are installed, which then crashes (https://discuss.yjs.dev/t/different-versions-of-yjs/1004, ueberdosis/hocuspocus#445, #577, #3209).

Im not aware of another solution to this, if there is one, let me know! 🙏

What you have to do now: When running npm install in your project, npm should complain about UNMET PEER DEPENDENCY, so just require them yourself and the error should be gone.

@Haraldson
Copy link

I’m getting no such warning from yarn, @janthurau.

@janthurau
Copy link
Collaborator

janthurau commented Dec 6, 2022

hmm, I just ran a test - with npm, I cannot reproduce any issue at all (tried the instructions from the initial post here).
With yarn, I'm getting the same error, however, yarn install (1.22.10) yields this:

[3/4] 🔗  Linking dependencies...
warning "@tiptap/starter-kit > @tiptap/core@2.0.0-beta.205" has unmet peer dependency "prosemirror-commands@^1.3.1".
warning "@tiptap/starter-kit > @tiptap/core@2.0.0-beta.205" has unmet peer dependency "prosemirror-keymap@^1.2.0".
warning "@tiptap/starter-kit > @tiptap/core@2.0.0-beta.205" has unmet peer dependency "prosemirror-model@^1.18.1".
warning "@tiptap/starter-kit > @tiptap/core@2.0.0-beta.205" has unmet peer dependency "prosemirror-schema-list@^1.2.2".
warning "@tiptap/starter-kit > @tiptap/core@2.0.0-beta.205" has unmet peer dependency "prosemirror-state@^1.4.1".
warning "@tiptap/starter-kit > @tiptap/core@2.0.0-beta.205" has unmet peer dependency "prosemirror-transform@^1.7.0".
warning "@tiptap/starter-kit > @tiptap/core@2.0.0-beta.205" has unmet peer dependency "prosemirror-view@^1.28.2".
warning "@tiptap/starter-kit > @tiptap/extension-code-block@2.0.0-beta.205" has unmet peer dependency "prosemirror-state@^1.4.1".
warning "@tiptap/starter-kit > @tiptap/extension-dropcursor@2.0.0-beta.205" has unmet peer dependency "prosemirror-dropcursor@1.5.0".
warning "@tiptap/starter-kit > @tiptap/extension-gapcursor@2.0.0-beta.205" has unmet peer dependency "prosemirror-gapcursor@^1.3.1".
warning "@tiptap/starter-kit > @tiptap/extension-history@2.0.0-beta.205" has unmet peer dependency "prosemirror-history@^1.3.0".
warning "@tiptap/starter-kit > @tiptap/extension-horizontal-rule@2.0.0-beta.205" has unmet peer dependency "prosemirror-state@^1.4.1".
warning "@tiptap/vue-3 > @tiptap/extension-bubble-menu@2.0.0-beta.205" has unmet peer dependency "@tiptap/core@^2.0.0-beta.193".
warning "@tiptap/vue-3 > @tiptap/extension-bubble-menu@2.0.0-beta.205" has unmet peer dependency "prosemirror-state@^1.4.1".
warning "@tiptap/vue-3 > @tiptap/extension-bubble-menu@2.0.0-beta.205" has unmet peer dependency "prosemirror-view@^1.28.2".
warning "@tiptap/vue-3 > @tiptap/extension-floating-menu@2.0.0-beta.205" has unmet peer dependency "@tiptap/core@^2.0.0-beta.193".
warning "@tiptap/vue-3 > @tiptap/extension-floating-menu@2.0.0-beta.205" has unmet peer dependency "prosemirror-state@^1.4.1".
warning "@tiptap/vue-3 > @tiptap/extension-floating-menu@2.0.0-beta.205" has unmet peer dependency "prosemirror-view@^1.28.2".
warning " > @tiptap/vue-3@2.0.0-beta.205" has unmet peer dependency "@tiptap/core@^2.0.0-beta.193".
warning " > @tiptap/vue-3@2.0.0-beta.205" has unmet peer dependency "prosemirror-state@^1.4.1".
warning " > @tiptap/vue-3@2.0.0-beta.205" has unmet peer dependency "prosemirror-view@^1.28.2".
[4/4] 🔨  Building fresh packages...

@Haraldson
Copy link

I’ve now tried some different things to get the editor up and running again;

  1. Adding the prosemirror-* dependencies to my project (Webpack stops complaining, but runtime error)
  2. Adding the same dependencies as explicit resolutions in my package.json (runtime error)
  3. Completely deleting my node_modules and yarn.lock between each step

The runtime error I’m getting:

RangeError: Adding different instances of a keyed plugin (plugin$)

I haven’t made any changes to any of the editor code, besides upgrading all tiptap dependencies.

There needs to be a clear guide on how to go about getting this up and running on tiptap.dev, it seems a bit rushed to include such a change without having that handy.

@w-A-L-L-e
Copy link

w-A-L-L-e commented Dec 6, 2022

Same issue here vue3 app + vite. Works fine on my machine but gives these errors when using inside a docker.
This solves it for me (thanks for the tip @massimopalmieri ):

npm i prosemirror-schema-list prosemirror-history prosemirror-dropcursor prosemirror-gapcursor prosemirror-keymap prosemirror-commands

Imho these should be deps of tiptap if it doesn't work without those.

@avitorio
Copy link

avitorio commented Dec 6, 2022

My project doesn't use vite and it also broke. It's weird because we are using 2.0.0-beta.202 as the exact version to avoid bumps breaking our project and still, new installs are being affected. I really don't get it... thought this peerDependencies change should only affect ^2.0.0-beta.205.

@nikolakanacki
Copy link

nikolakanacki commented Dec 6, 2022

@Haraldson and anyone else who stumps upon this:

Even if you lock down all @tiptap/... deps to ...-beta-204 (no caret, no tilde, exact semver dep), @tiptap/starter-kit@2.0.0-beta-204 still has carets in its deps, from yarn.lock:

...
"@tiptap/starter-kit@^2.0.0-beta.204":
  version "2.0.0-beta.204"
  resolved "https://registry.yarnpkg.com/@tiptap/starter-kit/-/starter-kit-2.0.0-beta.204.tgz#12fb0701d7c37f022b94042f430f1518beeea072"
  integrity sha512-VTjQFKyByBpCXk6k8s/o/xO5m98oJ/raLvDt3XLCehjMgqyePfv0tKjIg2MlPKe/Bbog1RgEix1O1RJy9vL4xw==
  dependencies:
    "@tiptap/core" "^2.0.0-beta.204"
    "@tiptap/extension-blockquote" "^2.0.0-beta.204"
    "@tiptap/extension-bold" "^2.0.0-beta.204"
    "@tiptap/extension-bullet-list" "^2.0.0-beta.204"
    "@tiptap/extension-code" "^2.0.0-beta.204"
    "@tiptap/extension-code-block" "^2.0.0-beta.204"
    "@tiptap/extension-document" "^2.0.0-beta.204"
    "@tiptap/extension-dropcursor" "^2.0.0-beta.204"
    "@tiptap/extension-gapcursor" "^2.0.0-beta.204"
    "@tiptap/extension-hard-break" "^2.0.0-beta.204"
    "@tiptap/extension-heading" "^2.0.0-beta.204"
    "@tiptap/extension-history" "^2.0.0-beta.204"
    "@tiptap/extension-horizontal-rule" "^2.0.0-beta.204"
    "@tiptap/extension-italic" "^2.0.0-beta.204"
    "@tiptap/extension-list-item" "^2.0.0-beta.204"
    "@tiptap/extension-ordered-list" "^2.0.0-beta.204"
    "@tiptap/extension-paragraph" "^2.0.0-beta.204"
    "@tiptap/extension-strike" "^2.0.0-beta.204"
    "@tiptap/extension-text" "^2.0.0-beta.204"
...

...and so those deps resolves to @tiptap/...@...-beta-205 which do not include prosemirror-... in their deps.

We had success with locking down our direct @tiptap/... deps to exactly 2.0.0-beta-204 (notice no semver prefix character) in our package.json and then manually installing all the missing prosemirror-... deps, for us it was:

...
    "prosemirror-commands": "^1.3.1",
    "prosemirror-dropcursor": "1.5.0",
    "prosemirror-gapcursor": "^1.3.1",
    "prosemirror-history": "^1.3.0",
    "prosemirror-keymap": "^1.2.0",
    "prosemirror-model": "^1.18.1",
    "prosemirror-schema-list": "^1.2.2",
    "prosemirror-state": "^1.4.1",
    "prosemirror-transform": "^1.7.0",
    "prosemirror-view": "^1.28.2",
...

Hope this helps someone.

@tiendatleo
Copy link

We are having the same issue on ^2.0.0-beta.84

@Haraldson
Copy link

Haraldson commented Dec 7, 2022

@nikolakanacki Thanks for the help, but for me this doesn’t change anything, I still get the RangeError: Adding different instances of a keyed plugin (plugin$) error.


There’s a possibility I’m the only one in this thread using any of the @tiptap-pro extensions (I’m using both emoji and unique-id), and that somehow those aren’t updated in the same way as the public ones? If so, please advice.

@DutchGerman
Copy link

Have the same issue @Haraldson describes (VueJS 2.7 + Vite), also added the prosemirror deps to our package.json

@DutchGerman
Copy link

DutchGerman commented Dec 8, 2022

It seems that prosemirror-state loads with multiple versions, adding the following resolutions to the package.json works for me:

  "resolutions": {
    "prosemirror-model": "1.18.1",
    "prosemirror-state": "1.4.1",
    "prosemirror-transform": "1.7.0",
    "prosemirror-view": "1.28.2"
  }

@PatrykKeska
Copy link

PatrykKeska commented Dec 14, 2022

I spent over two hours trying to fix it, finally worked for me. I hope I have saved some time for someone.
By the way. I did use it in Next.js version 13

"dependencies": {
        "@tiptap/core": "^2.0.0-beta.207",
        "@tiptap/react": "^2.0.0-beta.207",
        "@tiptap/starter-kit": "^2.0.0-beta.207",
        "prosemirror-commands": "^1.5.0",
        "prosemirror-dropcursor": "^1.6.1",
        "prosemirror-gapcursor": "^1.3.1",
        "prosemirror-history": "^1.3.0",
        "prosemirror-keymap": "^1.2.0",
        "prosemirror-schema-list": "^1.2.2",
    },

What I did step by step :
1.

yarn add prosemirror-commands prosemirror-keymap prosemirror-model prosemirror-schema-list prosemirror-state prosemirror-transform prosemirror-view

2.for starter-kit :

yarn add prosemirror-history prosemirror-dropcursor prosemirror-gapcursor

yarn add  @tiptap/core @tiptap/starter-kit

yarn add @tiptap/react

@Naddiseo
Copy link

@PatrykKeska, did that get rid of the "XXXX doesn't provide YYY, requested by ZZZZ" message that yarn emits for you?
I tried following your steps and I see:

➤ YN0000: ┌ Resolution step
➤ YN0002: │ @tiptap/react@npm:2.0.0-beta.207 [437d0] doesn't provide prosemirror-state (pe7855), requested by @tiptap/extension-floating-menu
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.207 doesn't provide prosemirror-commands (p0602a), requested by @tiptap/core
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.207 doesn't provide prosemirror-dropcursor (p9cbc1), requested by @tiptap/extension-dropcursor
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.207 doesn't provide prosemirror-gapcursor (pcbc8d), requested by @tiptap/extension-gapcursor
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.207 doesn't provide prosemirror-history (p7b6a5), requested by @tiptap/extension-history
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.207 doesn't provide prosemirror-keymap (p51b89), requested by @tiptap/core
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.207 doesn't provide prosemirror-model (pbdbb4), requested by @tiptap/core
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.207 doesn't provide prosemirror-schema-list (pb00bd), requested by @tiptap/core
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.207 doesn't provide prosemirror-state (p63819), requested by @tiptap/core
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.207 doesn't provide prosemirror-state (p7b431), requested by @tiptap/extension-code-block
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.207 doesn't provide prosemirror-state (pe219f), requested by @tiptap/extension-horizontal-rule
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.207 doesn't provide prosemirror-transform (p66fe5), requested by @tiptap/core
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.207 doesn't provide prosemirror-view (ped8c5), requested by @tiptap/core

@PatrykKeska
Copy link

@PatrykKeska, did that get rid of the "XXXX doesn't provide YYY, requested by ZZZZ" message that yarn emits for you? I tried following your steps and I see:

➤ YN0000: ┌ Resolution step
➤ YN0002: │ @tiptap/react@npm:2.0.0-beta.207 [437d0] doesn't provide prosemirror-state (pe7855), requested by @tiptap/extension-floating-menu
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.207 doesn't provide prosemirror-commands (p0602a), requested by @tiptap/core
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.207 doesn't provide prosemirror-dropcursor (p9cbc1), requested by @tiptap/extension-dropcursor
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.207 doesn't provide prosemirror-gapcursor (pcbc8d), requested by @tiptap/extension-gapcursor
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.207 doesn't provide prosemirror-history (p7b6a5), requested by @tiptap/extension-history
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.207 doesn't provide prosemirror-keymap (p51b89), requested by @tiptap/core
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.207 doesn't provide prosemirror-model (pbdbb4), requested by @tiptap/core
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.207 doesn't provide prosemirror-schema-list (pb00bd), requested by @tiptap/core
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.207 doesn't provide prosemirror-state (p63819), requested by @tiptap/core
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.207 doesn't provide prosemirror-state (p7b431), requested by @tiptap/extension-code-block
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.207 doesn't provide prosemirror-state (pe219f), requested by @tiptap/extension-horizontal-rule
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.207 doesn't provide prosemirror-transform (p66fe5), requested by @tiptap/core
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.207 doesn't provide prosemirror-view (ped8c5), requested by @tiptap/core

Right now, I did create a new project in Next.js, and I got only one warning :


warning "@tiptap/starter-kit > @tiptap/extension-dropcursor@2.0.0-beta.207" has incorrect peer dependency "prosemirror-dropcursor@1.5.0".

Did you try to use it after that? is it work?
I've checked a few projects, and for now, it is ok

Update: I did try to install steps: 3,4,1,2, and only then I got those warnings as well.

@Naddiseo
Copy link

to everyone following this bug: sorry for spamming you again.

@PatrykKeska, I followed your steps in order, however I have an older version already installed. I've now tried to remove the older version, removing the node_modules folder, and the yarn.lock file, and I'm still getting the yarn warnings.

For now I think I'm going to stick with the older version (beta-204) until the peer-dependency mess the later versions have is improved

@PatrykKeska
Copy link

to everyone following this bug: sorry for spamming you again.

@PatrykKeska, I followed your steps in order, however I have an older version already installed. I've now tried to remove the older version, removing the node_modules folder, and the yarn.lock file, and I'm still getting the yarn warnings.

For now I think I'm going to stick with the older version (beta-204) until the peer-dependency mess the later versions have is improved

I tried a few older versions and got the same error when using the component.
In the end, this way is working fine in Next.js 13, but honestly, I have yet to learn if it is only my case or not.

You got warnings but is it working or not?

@JenuelDev
Copy link

Any update on this? I am having issues... It would be awesome if this will be fixed early.
I am using Vite + Vue3 + TypeScript, followed the Vue 3 installation in the documentation but having an error.

@SalahAdDin
Copy link

I spent over two hours trying to fix it, finally worked for me. I hope I have saved some time for someone. By the way. I did use it in Next.js version 13

"dependencies": {
        "@tiptap/core": "^2.0.0-beta.207",
        "@tiptap/react": "^2.0.0-beta.207",
        "@tiptap/starter-kit": "^2.0.0-beta.207",
        "prosemirror-commands": "^1.5.0",
        "prosemirror-dropcursor": "^1.6.1",
        "prosemirror-gapcursor": "^1.3.1",
        "prosemirror-history": "^1.3.0",
        "prosemirror-keymap": "^1.2.0",
        "prosemirror-schema-list": "^1.2.2",
    },

What I did step by step : 1.

yarn add prosemirror-commands prosemirror-keymap prosemirror-model prosemirror-schema-list prosemirror-state prosemirror-transform prosemirror-view

2.for starter-kit :

yarn add prosemirror-history prosemirror-dropcursor prosemirror-gapcursor
yarn add  @tiptap/core @tiptap/starter-kit
yarn add @tiptap/react

Have the same but it still does not work for Gapcursor extension.

@svenadlung
Copy link
Contributor

Have the same but it still does not work for Gapcursor extension.

What exactly is not working? There is only one dependency to ProseMirror, which is a peer dependency: https://github.com/ueberdosis/tiptap/blob/main/packages/extension-gapcursor/package.json#L33

Did you add prosemirror-gapcursor ?

@SalahAdDin
Copy link

Have the same but it still does not work for Gapcursor extension.

What exactly is not working? There is only one dependency to ProseMirror, which is a peer dependency: https://github.com/ueberdosis/tiptap/blob/main/packages/extension-gapcursor/package.json#L33

Did you add prosemirror-gapcursor ?

  "dependencies": {
    "@strapi/icons": "1.4.1",
    "@tiptap/core": "2.0.0-beta.209",
    "@tiptap/extension-blockquote": "2.0.0-beta.209",
    "@tiptap/extension-bold": "2.0.0-beta.209",
    "@tiptap/extension-bullet-list": "2.0.0-beta.209",
    "@tiptap/extension-character-count": "2.0.0-beta.209",
    "@tiptap/extension-code": "2.0.0-beta.209",
    "@tiptap/extension-code-block": "2.0.0-beta.209",
    "@tiptap/extension-color": "2.0.0-beta.209",
    "@tiptap/extension-document": "2.0.0-beta.209",
    "@tiptap/extension-gapcursor": "2.0.0-beta.209",
    "@tiptap/extension-hard-break": "2.0.0-beta.209",
    "@tiptap/extension-heading": "2.0.0-beta.209",
    "@tiptap/extension-history": "2.0.0-beta.209",
    "@tiptap/extension-horizontal-rule": "2.0.0-beta.209",
    "@tiptap/extension-image": "2.0.0-beta.209",
    "@tiptap/extension-italic": "2.0.0-beta.209",
    "@tiptap/extension-link": "2.0.0-beta.209",
    "@tiptap/extension-list-item": "2.0.0-beta.209",
    "@tiptap/extension-ordered-list": "2.0.0-beta.209",
    "@tiptap/extension-paragraph": "2.0.0-beta.209",
    "@tiptap/extension-strike": "2.0.0-beta.209",
    "@tiptap/extension-table": "2.0.0-beta.209",
    "@tiptap/extension-table-cell": "2.0.0-beta.209",
    "@tiptap/extension-table-header": "2.0.0-beta.209",
    "@tiptap/extension-table-row": "2.0.0-beta.209",
    "@tiptap/extension-text": "2.0.0-beta.209",
    "@tiptap/extension-text-align": "2.0.0-beta.209",
    "@tiptap/extension-text-style": "2.0.0-beta.209",
    "@tiptap/extension-underline": "2.0.0-beta.209",
    "@tiptap/extension-youtube": "2.0.0-beta.209",
    "@tiptap/prosemirror-tables": "1.1.3",
    "@tiptap/react": "2.0.0-beta.209",
    "prosemirror-commands": "1.5.0",
    "prosemirror-gapcursor": "1.3.1",
    "prosemirror-history": "1.3.0",
    "prosemirror-keymap": "1.2.0",
    "prosemirror-model": "1.18.3",
    "prosemirror-schema-list": "1.2.2",
    "prosemirror-state": "1.4.2",
    "prosemirror-transform": "1.7.0",
    "prosemirror-view": "1.29.1",
    "react-icons": "4.7.1"
  },

Yeah, it is installed.

@sahilpurav
Copy link

I was using yarn. I switched to npm@8 which installs all peer dependancies by default. Before that I removed, package-lock.json and node_modules folder and reinstalled with npm install

@SalahAdDin
Copy link

I was using yarn. I switched to npm@8 which installs all peer dependencies by default. Before that, I removed, package-lock.json and node_modules folders and reinstalled them with npm install

Do we need still to install the prosemirror dependencies?

@sahilpurav
Copy link

I was using yarn. I switched to npm@8 which installs all peer dependencies by default. Before that, I removed, package-lock.json and node_modules folders and reinstalled them with npm install

Do we need still to install the prosemirror dependencies?

Not for me. It was automatically installed by "npm". Since npm@7, peerDependancies are automatically installed. So I did not have to install prosemirror dependancies manually.

@SalahAdDin
Copy link

SalahAdDin commented Dec 25, 2022

I was using yarn. I switched to npm@8 which installs all peer dependencies by default. Before that, I removed, package-lock.json and node_modules folders and reinstalled them with npm install

Do we need still to install the prosemirror dependencies?

Not for me. It was automatically installed by "npm". Since npm@7, peerDependancies are automatically installed. So I did not have to install prosemirror dependancies manually.

Ok, it didn't give me any problem with npm, about prosemirror dependencies, but I still get Adding different instances of a keyed plugin (plugin$).

For yarn, installing the prosemirror dependencies is a must.

@sahilpurav
Copy link

I was using yarn. I switched to npm@8 which installs all peer dependencies by default. Before that, I removed, package-lock.json and node_modules folders and reinstalled them with npm install

Do we need still to install the prosemirror dependencies?

Not for me. It was automatically installed by "npm". Since npm@7, peerDependancies are automatically installed. So I did not have to install prosemirror dependancies manually.

Ok, it didn't give me any problem with npm, about prosemirror dependencies, but I still get Adding different instances of a keyed plugin (plugin$).

For yarn, installing the prosemirror dependencies is a must.

Yes there's a definite problem when I use yarn. I have not faced a problem you mentioned, perhaps it is specific to your project and plugins.

@elzodxon
Copy link

I am having the same issue in my project.

I am using, Vue 3 + Vite + TS

@KrisCoulson
Copy link

Just ran into this issue, manually adding all of the missing prose-mirror dependency solved this for me.

yarn add prosemirror-commands prosemirror-history prosemirror-keymap prosemirror-model prosemirror-schema-list prosemirror-state prosemirror-transform prosemirror-view

This should be a higher priority bug given that it broken so many project as indicated by how many people have come to this issue.

@madeleineostoja
Copy link

madeleineostoja commented Jan 12, 2023

Tbh moving from deps to peer deps should have been a breaking semver change

EDIT: Totally forgot we’re dealing with a pre release version, ignore this

@SalahAdDin
Copy link

Tbh moving from deps to peer deps should have been a breaking semver change

Or at least, giving a warning recommendation in the CHANGELOG and documentation.

@svenadlung
Copy link
Contributor

@KrisCoulson I don't think it's correct to call the changes a bug. We understand the displeasure, as some users need to adjust their setup. We are also working on a solution that will make the situation a bit more comfortable (a package for ProseMirror dependencies).

@madeleineostoja As far as I know the semver spec does not provide a solution for breaking changes in pre releases, does it? When Tiptap leaves beta state, such changes would of course be incremented to the major version.

@SalahAdDin I agree that we could have communicated the Breaking Change better in the changelogs.

However, in the docs, this has happened in many places through highlighted boxes (f.ex. https://tiptap.dev/installation/react#2-install-the-dependencies) and a dedicated page (https://tiptap.dev/installation/peer-dependencies) with an explanation. Did we possibly miss any places?

@Naddiseo
Copy link

@svenadlung, unfortunately the peer-dependencies documentation still gives warning on yarn (v3):

$ yarn add prosemirror-commands prosemirror-keymap prosemirror-model prosemirror-schema-list prosemirror-state prosemirror-transform prosemirror-view
$ yarn add prosemirror-history prosemirror-dropcursor prosemirror-gapcursor
$ yarn
➤ YN0000: ┌ Resolution step
➤ YN0002: │ @tiptap/react@npm:2.0.0-beta.209 [437d0] doesn't provide prosemirror-state (pcc6ea), requested by @tiptap/extension-floating-menu
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.209 doesn't provide prosemirror-commands (p451e8), requested by @tiptap/core
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.209 doesn't provide prosemirror-dropcursor (p2359c), requested by @tiptap/extension-dropcursor
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.209 doesn't provide prosemirror-gapcursor (pbb60d), requested by @tiptap/extension-gapcursor
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.209 doesn't provide prosemirror-history (p489c9), requested by @tiptap/extension-history
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.209 doesn't provide prosemirror-keymap (pff287), requested by @tiptap/core
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.209 doesn't provide prosemirror-model (p1c800), requested by @tiptap/core
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.209 doesn't provide prosemirror-schema-list (p788f6), requested by @tiptap/core
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.209 doesn't provide prosemirror-state (p3bc43), requested by @tiptap/core
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.209 doesn't provide prosemirror-state (pa8d12), requested by @tiptap/extension-code-block
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.209 doesn't provide prosemirror-state (p354c9), requested by @tiptap/extension-horizontal-rule
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.209 doesn't provide prosemirror-transform (pd0b52), requested by @tiptap/core
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.209 doesn't provide prosemirror-view (p35525), requested by @tiptap/core
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 0s 317ms

package.json

{
"dependencies": {
    "//..others": "",
    "@tiptap/core": "2.0.0-beta.209",
    "@tiptap/extension-color": "^2.0.0-beta.209",
    "@tiptap/extension-text-style": "^2.0.0-beta.209",
    "@tiptap/react": "2.0.0-beta.209",
    "@tiptap/starter-kit": "2.0.0-beta.209",
    "next": "^12.3.4",
    "next-auth": "4.18.7",
    "prosemirror-commands": "^1.5.0",
    "prosemirror-dropcursor": "^1.6.1",
    "prosemirror-gapcursor": "^1.3.1",
    "prosemirror-history": "^1.3.0",
    "prosemirror-keymap": "^1.2.0",
    "prosemirror-model": "^1.18.3",
    "prosemirror-schema-list": "^1.2.2",
    "prosemirror-state": "^1.4.2",
    "prosemirror-transform": "^1.7.0",
    "prosemirror-view": "^1.29.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-hook-form": "^7.41.3",
    "//..others": ""
  },
}

@madeleineostoja
Copy link

Oop my bad I forgot tiptap v2 was still in beta! I just saw so many comments on this issue.

In that case yeah you use pre release you expect a rocky road 👍🏼

proke03 added a commit to proke03/starsound that referenced this issue Jan 30, 2023
proke03 added a commit to proke03/starsound that referenced this issue Jan 31, 2023
* chore: install cssnano and setup

* chore: install prosemirror- packages
ueberdosis/tiptap#3492

* Lazyload toaster, dialogs

* Remove "import *"
@JenuelDev
Copy link

image

@RomainLanz
Copy link

This issue should be locked as it has now a proper fix.

Install @tiptap/pm and you are done.

📚 https://github.com/ueberdosis/tiptap/releases/tag/v2.0.0-beta.210

@Naddiseo
Copy link

Naddiseo commented Feb 6, 2023

@RomainLanz, still an issue when using yarn:

# removed all tiptap and prose-mirror entries from package.json
$ rm -rf node_modules yarn.lock
$ yarn add  @tiptap/react @tiptap/pm @tiptap/starter-kit @tiptap/extension-color @tiptap/extension-text-style
➤ YN0000: ┌ Resolution step
➤ YN0061: │ w3c-hr-time@npm:1.0.2 is deprecated: Use your platform's native performance.now() and performance.timeOrigin.
➤ YN0032: │ fsevents@npm:2.3.2: Implicit dependencies on node-gyp are discouraged
➤ YN0061: │ @npmcli/move-file@npm:2.0.1 is deprecated: This functionality has been moved to @npmcli/fs
➤ YN0002: │ @workspace:. doesn't provide @tiptap/core (p666d5), requested by @tiptap/extension-color
➤ YN0002: │ @workspace:. doesn't provide @tiptap/core (p457d9), requested by @tiptap/extension-text-style
➤ YN0002: │ @workspace:. doesn't provide @tiptap/core (p09708), requested by @tiptap/pm
➤ YN0002: │ @workspace:. doesn't provide @tiptap/core (pf75c7), requested by @tiptap/react
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.212 doesn't provide @tiptap/pm (p1d537), requested by @tiptap/core
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.212 doesn't provide @tiptap/pm (pf0b85), requested by @tiptap/extension-code-block
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.212 doesn't provide @tiptap/pm (p12694), requested by @tiptap/extension-dropcursor
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.212 doesn't provide @tiptap/pm (p6053f), requested by @tiptap/extension-gapcursor
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.212 doesn't provide @tiptap/pm (pc41ff), requested by @tiptap/extension-history
➤ YN0002: │ @tiptap/starter-kit@npm:2.0.0-beta.212 doesn't provide @tiptap/pm (p7b1de), requested by @tiptap/extension-horizontal-rule
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 12s 573ms
➤ YN0000: ┌ Fetch step
➤ YN0019: │ write-file-atomic-npm-4.0.1-96ec744721-8f78023253.zip appears to be unused - removing
➤ YN0019: │ ws-npm-8.6.0-c92b4da32f-e2fca82059.zip appears to be unused - removing
➤ YN0019: │ yaml-npm-2.1.3-654a90032d-9131606232.zip appears to be unused - removing
➤ YN0019: │ yargs-npm-17.3.1-26b02c35fd-64fc2e32c5.zip appears to be unused - removing
➤ YN0019: │ yargs-parser-npm-21.0.0-d564c0a5d4-1e205fca1c.zip appears to be unused - removing
➤ YN0000: └ Completed in 2s 9ms
➤ YN0000: ┌ Link step
➤ YN0007: │ msw@npm:1.0.0 [437d0] must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 6s 703ms
➤ YN0000: Done with warnings in 21s 551ms

@RomainLanz
Copy link

@Naddiseo

As said, install @tiptap/pm.

@Naddiseo
Copy link

Naddiseo commented Feb 6, 2023

@RomainLanz I did, it's the second entry in the yarn add command

@svenadlung
Copy link
Contributor

The issues mentioned above should have been fixed with the last releases. Please leave a message, if not, I will open again.

u-ecmaker added a commit to ECMaker/blog that referenced this issue Jul 19, 2023
u-ecmaker added a commit to ECMaker/blog that referenced this issue Jul 19, 2023
npm add
 prosemirror-commands
 prosemirror-history
 prosemirror-keymap
 prosemirror-model
 prosemirror-schema-list
 prosemirror-state
 prosemirror-transform
 prosemirror-view

ueberdosis/tiptap#3492
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug The issue or pullrequest is related to a bug
Projects
None yet
Development

No branches or pull requests