Editing text in Safari/macOS gives JavaScript error: undefined is not an object (evaluating 'navigator.clipboard write') #12955

Closed
opened 2025-11-02 10:26:16 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @DD-P on GitHub (May 5, 2024).

Description

On typing, the web page displays the above JavaScript clipboard error with eg (http://rad.gitea:12080/assets/js/monaco.14c11225.js @ 415:16905).

This appears to relate to the update of monaco-editor from 0.44.0 to 0.45.0 in ce55a74374

I suspect this only occurs when serving over http rather than https as the error does not occur on https://try.gitea.io/

Presumably monaco-editor is now using the async clipboard API. See https://webkit.org/blog/10855/async-clipboard-api/

Gitea Version

1.22.0-rc1

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

Screenshot 2024-05-05 at 4 47 14 PM copy

Git Version

2.40.1

Operating System

Ubuntu 23.10

How are you running Gitea?

Dockerised on Proxmox 8.2

Database

MySQL/MariaDB

Originally created by @DD-P on GitHub (May 5, 2024). ### Description On typing, the web page displays the above JavaScript clipboard error with eg `(http://rad.gitea:12080/assets/js/monaco.14c11225.js @ 415:16905)`. This appears to relate to the update of **monaco-editor** from 0.44.0 to 0.45.0 in ce55a74374aa1fe07cfb79ceeb8554aa7a2abce2 I suspect this only occurs when serving **over http** rather than https as the error does not occur on https://try.gitea.io/ Presumably monaco-editor is now using the async clipboard API. See https://webkit.org/blog/10855/async-clipboard-api/ ### Gitea Version 1.22.0-rc1 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots ![Screenshot 2024-05-05 at 4 47 14 PM copy](https://github.com/go-gitea/gitea/assets/1289710/41b29043-9c9d-4c5d-aaf0-982b79c49163) ### Git Version 2.40.1 ### Operating System Ubuntu 23.10 ### How are you running Gitea? Dockerised on Proxmox 8.2 ### Database MySQL/MariaDB
GiteaMirror added the type/bugtype/upstream labels 2025-11-02 10:26:16 -06:00
Author
Owner

@wxiaoguang commented on GitHub (May 5, 2024):

Could you try 1.22-nightly? The editor has been updated to #30713, I can not reproduce the JS error by my Safari now.

Docker images could be got from https://hub.docker.com/r/gitea/gitea/tags?page=&page_size=&ordering=&name=1.22-nightly, binary 1.22 nightly could be downloaded from https://dl.gitea.com/gitea/1.22/

By the way @techknowlogick , would we like to rename the directory to 1.22-nightly to match the docker image names?

@wxiaoguang commented on GitHub (May 5, 2024): Could you try 1.22-nightly? The editor has been updated to #30713, I can not reproduce the JS error by my Safari now. Docker images could be got from https://hub.docker.com/r/gitea/gitea/tags?page=&page_size=&ordering=&name=1.22-nightly, binary 1.22 nightly could be downloaded from https://dl.gitea.com/gitea/1.22/ By the way @techknowlogick , would we like to rename the directory to 1.22-nightly to match the docker image names?
Author
Owner

@wxiaoguang commented on GitHub (May 5, 2024):

Oops, sorry that #30713 is not backported to 1.22 ..... 😭

Checked again. 30713 is in 1.22-nightly (I misread ....)

@wxiaoguang commented on GitHub (May 5, 2024): ~~Oops, sorry that #30713 is not backported to 1.22 ..... 😭~~ Checked again. 30713 is in 1.22-nightly (I misread ....)
Author
Owner

@DD-P commented on GitHub (May 5, 2024):

Thank you for quick response. No 1.22-nightly still errors.
Screenshot 2024-05-05 at 6 11 02 PM copy
Screenshot 2024-05-05 at 6 10 53 PM copy

@DD-P commented on GitHub (May 5, 2024): Thank you for quick response. No 1.22-nightly still errors. ![Screenshot 2024-05-05 at 6 11 02 PM copy](https://github.com/go-gitea/gitea/assets/1289710/8ca48ed4-04ad-49ff-a857-b8006275b810) ![Screenshot 2024-05-05 at 6 10 53 PM copy](https://github.com/go-gitea/gitea/assets/1289710/0e758998-18c1-4846-8720-15771b29a3ad)
Author
Owner

@wxiaoguang commented on GitHub (May 5, 2024):

Hmm, it seems to be a longstanding problem in monaco-editor, the code is 3-year old. (TBH, I have no idea why it only happens in 1.22/main .....)

53c1b7b87c/src/vs/platform/clipboard/browser/clipboardService.ts (L55C10-L55C42)

Until upstream has a fix (https://github.com/microsoft/monaco-editor/issues/4496), we could ignore such error by: Do not show monaco JS errors #30862

@wxiaoguang commented on GitHub (May 5, 2024): Hmm, it seems to be a longstanding problem in monaco-editor, the code is 3-year old. (TBH, I have no idea why it only happens in 1.22/main .....) https://github.com/microsoft/vscode/blame/53c1b7b87c7d8aebafdd1e2fbbdbdb04a95612b3/src/vs/platform/clipboard/browser/clipboardService.ts#L55C10-L55C42 Until upstream has a fix (https://github.com/microsoft/monaco-editor/issues/4496), we could ignore such error by: Do not show monaco JS errors #30862
Author
Owner

@wxiaoguang commented on GitHub (May 6, 2024):

1.22 nightly including #30866 is ready.

Welcome to take a try and if there is still any problem, please help to report. Thank you very much!

image

image

@wxiaoguang commented on GitHub (May 6, 2024): 1.22 nightly including #30866 is ready. Welcome to take a try and if there is still any problem, please help to report. Thank you very much! ![image](https://github.com/go-gitea/gitea/assets/2114189/f711d0fc-987e-457a-ac0e-d19f76cfb658) ![image](https://github.com/go-gitea/gitea/assets/2114189/05d17892-74cd-46f3-936f-18094942beed)
Author
Owner

@DD-P commented on GitHub (May 6, 2024):

Fix in nightly seems perfect. Thank you very much for fixing this so promptly.

@DD-P commented on GitHub (May 6, 2024): Fix in nightly seems perfect. Thank you very much for fixing this so promptly.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12955