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

TypeError: WeakMap key undefined (caused by extension DarkReader's bug) #28861

Closed
thechubbypanda opened this issue Jan 19, 2024 · 8 comments
Closed
Labels
topic/ui Change the appearance of the Gitea UI type/bug

Comments

@thechubbypanda
Copy link

Description

JavaScript error: TypeError: WeakMap key undefined must be an object or an unregistered symbol (https://try.gitea.io/ @ 529:36). Open browser console to see more details.
worker port event error 
Object { type: "error", data: undefined }
index.js:30:76443
    Tg https://try.gitea.io/assets/js/index.js?v=1.21.4:30

This does not occur in a private window, I have tried to clear cookies and site data, no change.

Screenshots

Screenshot_20240119_200337

Gitea Version

1.22.0+dev-575-gd68a613ba

Can you reproduce the bug on the Gitea demo site?

Yes

Operating System

Firefox

Browser Version

121.0

@thechubbypanda thechubbypanda added topic/ui Change the appearance of the Gitea UI type/bug labels Jan 19, 2024
@techknowlogick
Copy link
Member

You wouldn't happen to be using the "dark reader" extension?

@techknowlogick
Copy link
Member

possibly related: #28226

@puc9
Copy link

puc9 commented Jan 20, 2024

You wouldn't happen to be using the "dark reader" extension?

Disabling the dark reader extension for gitea fixed it for me

@thechubbypanda
Copy link
Author

Goddammit darkreader

@SirCypher
Copy link

This happens only in Firefox since the last DarkReader update.
I opened an issue at darkreader/darkreader#12180

@wxiaoguang wxiaoguang changed the title TypeError: WeakMap key undefined TypeError: WeakMap key undefined (caused by extension DarkReader's bug) Jan 20, 2024
@wxiaoguang
Copy link
Contributor

On Gitea side, we could do this: Avoid duplicate JS error messages on UI #28873

lunny pushed a commit that referenced this issue Jan 21, 2024
Gitea treat JS errors seriously, so sometimes the JS errors caused by
3rdparty code (eg: browser extensions) would also be reported on Gitea
UI: TypeError: WeakMap key undefined (caused by extension DarkReader's
bug) #28861

To avoid fill the user's screen with a lot of error messages, this PR
merges the same error messages into one, like this:

```js
<div class="page-content">
  <div class="... js-global-error" data-global-error-msg-compact="testmsg1" data-global-error-msg-count="2">test msg 1 (2)</div>
  <div class="... js-global-error" data-global-error-msg-compact="testmsg2" data-global-error-msg-count="1">test msg 2</div>
</div>
```
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Jan 21, 2024
Gitea treat JS errors seriously, so sometimes the JS errors caused by
3rdparty code (eg: browser extensions) would also be reported on Gitea
UI: TypeError: WeakMap key undefined (caused by extension DarkReader's
bug) go-gitea#28861

To avoid fill the user's screen with a lot of error messages, this PR
merges the same error messages into one, like this:

```js
<div class="page-content">
  <div class="... js-global-error" data-global-error-msg-compact="testmsg1" data-global-error-msg-count="2">test msg 1 (2)</div>
  <div class="... js-global-error" data-global-error-msg-compact="testmsg2" data-global-error-msg-count="1">test msg 2</div>
</div>
```
wxiaoguang added a commit that referenced this issue Jan 21, 2024
Backport #28873 by wxiaoguang

Gitea treat JS errors seriously, so sometimes the JS errors caused by
3rdparty code (eg: browser extensions) would also be reported on Gitea
UI: TypeError: WeakMap key undefined (caused by extension DarkReader's
bug) #28861

To avoid fill the user's screen with a lot of error messages, this PR
merges the same error messages into one.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@staticfrost
Copy link

had this happening to me too. thanks for fixing it!

henrygoodman pushed a commit to henrygoodman/gitea that referenced this issue Jan 31, 2024
Gitea treat JS errors seriously, so sometimes the JS errors caused by
3rdparty code (eg: browser extensions) would also be reported on Gitea
UI: TypeError: WeakMap key undefined (caused by extension DarkReader's
bug) go-gitea#28861

To avoid fill the user's screen with a lot of error messages, this PR
merges the same error messages into one, like this:

```js
<div class="page-content">
  <div class="... js-global-error" data-global-error-msg-compact="testmsg1" data-global-error-msg-count="2">test msg 1 (2)</div>
  <div class="... js-global-error" data-global-error-msg-compact="testmsg2" data-global-error-msg-count="1">test msg 2</div>
</div>
```
silverwind pushed a commit to silverwind/gitea that referenced this issue Feb 20, 2024
Gitea treat JS errors seriously, so sometimes the JS errors caused by
3rdparty code (eg: browser extensions) would also be reported on Gitea
UI: TypeError: WeakMap key undefined (caused by extension DarkReader's
bug) go-gitea#28861

To avoid fill the user's screen with a lot of error messages, this PR
merges the same error messages into one, like this:

```js
<div class="page-content">
  <div class="... js-global-error" data-global-error-msg-compact="testmsg1" data-global-error-msg-count="2">test msg 1 (2)</div>
  <div class="... js-global-error" data-global-error-msg-compact="testmsg2" data-global-error-msg-count="1">test msg 2</div>
</div>
```
Copy link

Automatically locked because of our CONTRIBUTING guidelines

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/ui Change the appearance of the Gitea UI type/bug
Projects
None yet
Development

No branches or pull requests

6 participants