sibiraj-s / ngx-editor

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

[Bug]: looks like multiple versions of prosemirror-model were loaded #500

Closed thomas-parrish closed 10 months ago

thomas-parrish commented 1 year ago

What happened?

When pressing Enter (inserting a new line), I get the follow error:

Uncaught RangeError: Can not convert <> to a Fragment (looks like multiple versions of prosemirror-model were loaded)

This seems to be caused by the ngx-editor prose dependencies referencing different versions of prosemirror-model. In my yarn.lock, I see that ngx-editor requires prosemirror-commands v1.5 (which depends on prosemirror-model ^1.0), but explicitly references prosemirror-model v1.19.0. (And some other prose dependencies reference ^1.16.0).

I believe that changing the ngx-editor dependencies to require ^1.16.0 should resolve the issue, as every dependency should then resolve to the latest version after 1.16 (currently 1.19.3), therefore preventing multiple versions from being loaded.

I found a workaround and explanation of the issue here:

Version

15.3.0

Angular Version

16.2.6

What browsers are you seeing the problem on?

Firefox

Link to reproduce

No response

Relevant log output

No response

Willing to submit a PR?

None

sibiraj-s commented 10 months ago

Sorry for the delayed reply, sometimes this happens during the upgrade where either transitive dependencies gets not updated or the direct ones gets updated and transitive ones or not.

The most simplest solution is to delete lock file and node_modules and install again or the ones mentioned on this thread.

I am not sure at this point there is a fixed solution that exists to close this completely.

Thanks.

github-actions[bot] commented 9 months ago

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.