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

[Bug]: Unmet peer dependency "@tiptap/core@^2.0.0" on "yarn"command from "@tiptap/pm", "@tiptap/react" and tiptap extensions #4100

Open
1 of 2 tasks
nk11dev opened this issue Jun 2, 2023 · 9 comments
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Triage: Open A new issue or pullrequest that requires triage (added by default) Type: Bug The issue or pullrequest is related to a bug

Comments

@nk11dev
Copy link

nk11dev commented Jun 2, 2023

Which packages did you experience the bug in?

"@tiptap/pm": "2.0.3", "@tiptap/react": "2.0.3", "@tiptap/extension-list-item": "2.0.3", "@tiptap/extension-text-style": "2.0.3"

What Tiptap version are you using?

2.0.3

What’s the bug you are facing?

I am using TipTap with React and have these dependencies in package.json

"@tiptap/extension-list-item": "2.0.3",
"@tiptap/extension-text-style": "2.0.3",
"@tiptap/pm": "2.0.3",
"@tiptap/react": "2.0.3",
"@tiptap/starter-kit": "2.0.3",

As docs from https://tiptap.dev/installation/react said, there is no dependency from @tiptap/core if you are using TipTap with React.

For npm install command, everything is ok.

But, when I executing a yarn command for installing dependencies, then these warnings appear:

warning " > @tiptap/extension-list-item@2.0.3" has unmet peer dependency "@tiptap/core@^2.0.0".
warning " > @tiptap/extension-text-style@2.0.3" has unmet peer dependency "@tiptap/core@^2.0.0".
warning " > @tiptap/pm@2.0.3" has unmet peer dependency "@tiptap/core@^2.0.0".
warning " > @tiptap/react@2.0.3" has unmet peer dependency "@tiptap/core@^2.0.0".

What browser are you using?

Chrome

Code example

No response

What did you expect to happen?

There should be no warnings.

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. 💖
@nk11dev nk11dev added Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Triage: Open A new issue or pullrequest that requires triage (added by default) Type: Bug The issue or pullrequest is related to a bug labels Jun 2, 2023
@nk11dev nk11dev changed the title Unmet peer dependency "@tiptap/core@^2.0.0" on "yarn"command from "@tiptap/pm", "@tiptap/react" and tiptap extensions [Bug] Unmet peer dependency "@tiptap/core@^2.0.0" on "yarn"command from "@tiptap/pm", "@tiptap/react" and tiptap extensions Jun 2, 2023
@nk11dev nk11dev changed the title [Bug] Unmet peer dependency "@tiptap/core@^2.0.0" on "yarn"command from "@tiptap/pm", "@tiptap/react" and tiptap extensions [Bug]: Unmet peer dependency "@tiptap/core@^2.0.0" on "yarn"command from "@tiptap/pm", "@tiptap/react" and tiptap extensions Jun 2, 2023
@Naddiseo
Copy link

Naddiseo commented Jun 2, 2023

Seems like the same issue I was facing: #3746 My workaround was adding a peerDependencies override in yarnrc

@lensbart
Copy link

lensbart commented Jun 3, 2023

The workaround mentioned above:

# yarnrc.yml
packageExtensions:
  # awaiting fix: https://github.com/ueberdosis/tiptap/issues/4100
  '@tiptap/starter-kit@*':
    dependencies:
      '@tiptap/pm': '*'

@nk11dev
Copy link
Author

nk11dev commented Jun 5, 2023

Thanks for workaround.
But, I added .yarnrc.yml to my root directory, then tried reinstalling all dependencies with yarn and nothing has changed (warnings are still there).

This is content of my .yarnrc.yml:

packageExtensions:
  "@tiptap/react@*":
    peerDependencies:
      "@tiptap/core": "*"
  "@tiptap/pm@*":
    peerDependencies:
      "@tiptap/core": "*"  
  "@tiptap/extension-list-item@*":
    peerDependencies:
      "@tiptap/core": "*"
  "@tiptap/extension-text-style@*":
    peerDependencies:
      "@tiptap/core": "*"

I also tried with dependencies instead of peerDependencies, but nothing changed.

@Naddiseo, @lensbart guys, сan you tell me if I'm missing something or doing something wrong?

@lensbart
Copy link

lensbart commented Jun 5, 2023

@nk11dev there are more differences between your code and what works for me than just dependencies/peerDependencies. Please try with what I provided. If that doesn’t work, you can change your code by setting optional: true in the peerDependenciesMeta field.

@nk11dev
Copy link
Author

nk11dev commented Jun 5, 2023

@nk11dev there are more differences between your code and what works for me than just dependencies/peerDependencies. Please try with what I provided. If that doesn’t work, you can change your code by setting optional: true in the peerDependenciesMeta field.

It seems like .yarnrc.yml wasn't working at all in my case, because I used classic version of yarn (1.x ) instead of modern yarn.

I switched to modern version of yarn (it's version 3.6.0 at the moment) with command yarn set version berry.
Then I removed my previous yarn.lock file, added lines below to .yarnrc.yml, did a fresh install with yarn command and warnings are gone.

packageExtensions:
  "@tiptap/react@*":
    peerDependenciesMeta:
      "@tiptap/core":
        optional: true

  "@tiptap/pm@*":
    peerDependenciesMeta:
      "@tiptap/core":
        optional: true

  "@tiptap/extension-list-item@*":
    peerDependenciesMeta:
      "@tiptap/core":
        optional: true

  "@tiptap/extension-text-style@*":
    peerDependenciesMeta:
      "@tiptap/core":
        optional: true

But, of cause, I think that these warnings should be fixed in "tiptap" package itself.

@nk11dev
Copy link
Author

nk11dev commented Jun 5, 2023

It's important to mention that if you also use npm as package manager in your project with it's npx utility (that uses node_modules directory), than you can't just switch to modern yarn, because it uses Plug'n'Play installation strategy instead of node_modules.

It will require some changes to your setup to rewrite your scripts and test if all is working as expected if you want to move to modern yarn.

Therefore the fix in the "tiptap" package itself remains much more preferable.

@Naddiseo
Copy link

Naddiseo commented Jun 5, 2023

It's important to mention that if you also use npm as package manager in your project with it's npx utility (that uses node_modules directory), than you can't just switch to modern yarn, because it uses Plug'n'Play installation strategy instead of node_modules.

It will require some changes to your setup to rewrite your scripts and test if all is working as expected if you want to move to modern yarn.

Therefore the fix in the "tiptap" package itself remains much more preferable.

Or just use nodeLinker: node-modules ?

@nk11dev
Copy link
Author

nk11dev commented Jun 5, 2023

Or just use nodeLinker: node-modules ?

Thanks, I will take a look into modern yarn migration more closely.

I mean, the adding of packageExtensions to .yarnrc.yml described above, may not be enough to make the whole app work as expected, until you set up what you need besides this. And it's already beyond the scope of a quick fix to remove the dependency warnings in my opinion. Maybe something else will pop up, maybe not. Can't tell until I've dived into it.

@jun-regcentric
Copy link

Any update on this? As this should be resolve in the tiptap itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Triage: Open A new issue or pullrequest that requires triage (added by default) Type: Bug The issue or pullrequest is related to a bug
Projects
Status: Triage open
Development

No branches or pull requests

6 participants