Closed jecraig closed 6 months ago
Hmm, I've tried that and then some. Even went to the point of installing it fresh on a new angular project and got this issue.
I'll try sending this on towards the Yarn team.
Oh.
I don't use Yarn. not sure whats happening there. Open to improvements.
Looking into it more but this appears to be the culprit of the conflicting types. For some reason, prosemirror-view and prosemirror-model are embedded in the yarn install in addition to the lifted folder copy. I don't have an idea on the reason yet but I figured I'd update in case anyone else has an idea.
NPM Left - Yarn Right
@sibiraj-s The issue is with version resolution. The ngx-editor package is requiring prosemirror-view 1.31.7, but something else requires version 1.32.7. So yarn installs a local package to ngx-editor and the higher version to the root node_modules folder. A similar issue happens with prosemirror-model where ngx-editor wants 1.19.3 but the root also needs to install 1.19.4.
Changing the semantic versioning in projects/ngx-editor/package.json to carets instead of fixed versions resolves the conflict.
To everyone else, as a temporary workaround you can add the following to your package.json to force the resolution.
"resolutions": {
"prosemirror-commands": "^1.5.2",
"prosemirror-history": "^1.3.2",
"prosemirror-inputrules": "^1.2.1",
"prosemirror-keymap": "^1.2.2",
"prosemirror-model": "^1.19.3",
"prosemirror-schema-list": "^1.3.0",
"prosemirror-state": "^1.4.3",
"prosemirror-view": "^1.31.7"
},
@jakyle this should directly solve your issue in https://github.com/sibiraj-s/ngx-editor/issues/469
but something else requires version 1.32.7.
This is possible because of one of the Prosemirror package doesn't pin its dependency.
Changing the semantic versioning in projects/ngx-editor/package.json to carets instead of fixed versions resolves the conflict. In the past it was like this, when caret is used, during either angular version or the editor version updates. Some version mismatch often happens. I've pinned the dependency directly dependency to avoid this issue, if not pinned this same issue would become at-least 10x more frequent, during version updates.
Also, it was the time when Prosemirror was made stable initially and it was breaking things often. Its been a while since stable, thinking if I should put it to caret again. Not sure.
Fortunately Yarn does provide a method to solve this by forcing the decency resolutions. If you decide not to open up semantic versioning then perhaps a note about fixing resolution conflicts in the Yarn section of the docs.
Yeah. Thanks will mention them in docs. I'll try open up semver if possible, because it also makes me to release new version for each updates.
Fixed in v17.1.0. dependencies are no longer pinned
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in the thread.
What happened?
Type conflict when using Yarn. It appears to be an issue with prosemirror-view types. The issue doesn't happen with npm.
Tested with Yarn 4 and Yarn 1.22, both errored.
Version
v16.0.1
Angular Version
v16.2.12
What browsers are you seeing the problem on?
Firefox, Chrome
Link to reproduce
https://github.com/jecraig/ngxeditor-yarn-example
Relevant log output
Willing to submit a PR?
None