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

Prevent duplicate loading of yjs when workspace and viewer open text #3825

Closed
max-nextcloud opened this issue Feb 24, 2023 · 2 comments · Fixed by #4542
Closed

Prevent duplicate loading of yjs when workspace and viewer open text #3825

max-nextcloud opened this issue Feb 24, 2023 · 2 comments · Fixed by #4542

Comments

@max-nextcloud
Copy link
Collaborator

Describe the bug
When opening both the Readme.md in the workspace and a file in the viewer the following error shows up in the console:

Yjs was already imported. This breaks constructor checks and will lead to issues! - yjs/yjs#438

To Reproduce
Steps to reproduce the behavior:
1.Create a folder description.
2. Create a test file
3. Open console
4. See error message there

Expected behavior
We should only import Yjs once and avoid that error message.

Screenshots
grafik

@luka-nextcloud
Copy link
Contributor

This is a reproducible bug.

@max-nextcloud
Copy link
Collaborator Author

I wonder if it is due to the dynamic loading of Editor.vue. Both the rich workspace and the viewer component load it dynamically with
Editor: () => import(/* webpackChunkName: "editor" */'./../components/Editor.vue'),
We will want to keep this i think because it reduces the size of the view component and rich workspace artifacts and they can share the editor.
But if normal imports would fix the duplicate loading it might be an idea to use normal imports for yjs and then inject the yjs doc ($ydoc) into the Editor either via props or with provide / inject.

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

Successfully merging a pull request may close this issue.

3 participants