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

ERROR RangeError: Can not convert <> to a Fragment (looks like multiple versions of prosemirror-model were loaded)[Bug]: #552

Open
ravirajyaguru1 opened this issue May 29, 2024 · 7 comments

Comments

@ravirajyaguru1
Copy link

What happened?

While clicking enter in ngx-editor getting range error in google chrome.

Version

14.2.0

Angular Version

16.2.14

What browsers are you seeing the problem on?

Chrome

Link to reproduce

No response

Relevant log output

No response

Willing to submit a PR?

None

@sibiraj-s
Copy link
Owner

Try deleting lockfile and node_modules and re-install again?

@mandeepBartwal1079
Copy link

I deleted my node_modules and reinstalled it, but it still doesn't work for me.

@MaximeOpsommer
Copy link

MaximeOpsommer commented Jun 26, 2024

Hello, I encountered the same issue today and noticed this happens only when we select the end of the text.

Version : 15.3.0
Angular version : 14.2.12
Browser : Chrome

It looks that Enter adds a <p> tag while Shift + Enter adds a <br> tag. Is there any fix or turnaround to prevent default behavior and manually trigger <p> addition at the current position when pressing Enter key

I also tried to delete my node_modules and package.lock and reinstall it, but it had no effect

EDIT: This happens when pressing Enter at the end of a <p> tag

@nardo7
Copy link

nardo7 commented Jul 5, 2024

Any update on this? @MaximeOpsommer did you find a workaround?
Deleting node_modules and package.lock and reinstall does not work for me.
I had to add the following in package.json to make it work. Then I had to delete lock file and node_modules and reisntall

"overrides": {
    "prosemirror-model": "1.19.3"
  },

This was the previous corrupted package dependency before
Screenshot 2024-07-05 at 14 02 19

@nardo7
Copy link

nardo7 commented Jul 5, 2024

Updating to [email protected] resolved the issue for me. It installs only one version of prosemirror-model
Screenshot 2024-07-05 at 14 31 05

@MaximeOpsommer
Copy link

Any update on this? @MaximeOpsommer did you find a workaround?

Nope, my solution was to move to ngx-quill 😅

@sibiraj-s
Copy link
Owner

I'll add a documentation for this. This is often repeated and happening because of prosemirror transitive dependencies. The only solution is to re-install prosemirror packages so there are no duplication. And make sure its not installed separately or by any other packages. This mostly happens during the package update I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants