sibiraj-s / ngx-editor

🖋️ Rich Text Editor for angular using ProseMirror
https://sibiraj-s.github.io/ngx-editor/
MIT License
457 stars 191 forks source link

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

Open ravirajyaguru1 opened 5 months ago

ravirajyaguru1 commented 5 months ago

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 commented 5 months ago

Try deleting lockfile and node_modules and re-install again?

mandeepBartwal1079 commented 5 months ago

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

MaximeOpsommer commented 5 months ago

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 commented 4 months ago

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 commented 4 months ago

Updating to ngx-editor@17.5.4 resolved the issue for me. It installs only one version of prosemirror-model Screenshot 2024-07-05 at 14 31 05

MaximeOpsommer commented 4 months ago

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

Nope, my solution was to move to ngx-quill :sweat_smile:

sibiraj-s commented 4 months ago

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.