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

​cannot copy in the document #8585

Open
1 task done
BadboyXiaobai opened this issue Oct 23, 2024 · 2 comments
Open
1 task done

​cannot copy in the document #8585

BadboyXiaobai opened this issue Oct 23, 2024 · 2 comments

Comments

@BadboyXiaobai
Copy link

What happened?

I have deployed the AFFiNE service on my NAS server, which runs the latest version of Feiniu O,AFFiNE version is 0.16.0-nightly-eb0466e. I used the official script to deploy it to Docker with one click. During use, I found that I cannot copy any content from the document to the clipboard, but I can paste the clipboard content into the document. When I pressed F12 to check the browser console information, I found an error when copying, and the error message is as follows:
TypeError: Cannot read properties of undefined (reading 'write') at h.writeToClipboard (index.ts:357:31) at async h.copySlice (index.ts:168:5)

I suspect there might be an issue with my installation script or the AFFiNE version, so I cloned the latest version of the software from GitHub and installed it in Docker using compose.yaml. The version number is 0.17.5, but the problem persists. Therefore, I believe it might be a software issue rather than a system or configuration problem. I'm going to provide feedback on GitHub, hoping it can contribute to the project.

Distribution version

Linux

What browsers are you seeing the problem on if you're using web version?

Chrome, Microsoft Edge

Are you self-hosting?

  • Yes

Relevant log output

No response

Anything else?

No response

@forehalo
Copy link
Member

forehalo commented Oct 24, 2024

navigator.clipboard api is used in copy module and it requires secure context(https) in non-localhost environment. Im hoping @fourdim is on this, replacing navigator.clipboard with ClipboardEvent if it's blocked

@fourdim
Copy link
Contributor

fourdim commented Oct 24, 2024

Closed by toeverything/blocksuite#8587
Noted, you will experience performance downgrade if secure context is disabled.

Include but not limit to:

  • Cannot copy image
  • Copied text are malformed
  • Copied text does not have any styles
  • Pasted text are malformed
  • Pasted text does not have any styles
  • The editor works abnormally after paste

You can still enable the secure context by following the guideline below:
https://docs.affine.pro/docs/self-host-affine#why-my-selfhosted-version-does-not-support-copy--paste

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

3 participants