wobsoriano / lexical-vue

An extensible Vue 3 web text-editor based on Lexical.
https://lexical-vue.vercel.app/
MIT License
239 stars 29 forks source link

Is there a way to make the yjs lib optional? #29

Closed Madd0g closed 6 months ago

Madd0g commented 8 months ago

I'm not using that plugin and I can't start my app without installing yjs.

After installing it, I see errors like this:

Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438

is there a way to not load it if I don't need it?

Thanks

wobsoriano commented 8 months ago

Yeah, I can make it an optional dep. Working on this asap

fucktic commented 7 months ago

X [ERROR] Could not resolve "yjs"

node_modules/lexical-vue/dist/index.js:1224:28:
  1224 │ import { UndoManager } from "yjs";
       ╵                             ~~~~~

You can mark the path "yjs" as external to exclude it from the bundle, which will
remove this error and leave the unresolved path in the bundle.

Madd0g commented 7 months ago

I believe I tried that, but it's been a while so I don't remember what the problem was when I tried it.

Since I'm getting warning messages in the console from yjs itself, that means something "initiates" it and it's not my code - so I think that's what happened, even if you make it external, it's still trying to use it and blows up.

wobsoriano commented 6 months ago

It should now be optional. Tested it on a fresh project with Vite. Feel free to reopen!