ReferenceError: EventSource is not defined in Pale Moon #9298

Closed
opened 2025-11-02 08:34:32 -06:00 by GiteaMirror · 13 comments
Owner

Originally created by @u3shit on GitHub (Jul 31, 2022).

Description

After updating to 1.17.0 with javascript enabled this time, after logging in I start getting errors about EventSource (see screenshot). (It doesn't happen when I'm logged out)

Developer console:

18:25:45.836 error { target: SharedWorker, isTrusted: true, message: "ReferenceError: EventSource is not defined", filename: "http://localhost:3000/assets/js/eventsource.sharedworker.js", lineno: 1, colno: 85, srcElement: SharedWorker, eventPhase: 0, bubbles: false, cancelable: true, defaultPrevented: false }  
index.js:58:1724
	ev/< http://localhost:3000/assets/js/index.js:58:1724
18:25:45.836 error { target: SharedWorker, isTrusted: true, message: "ReferenceError: EventSource is not defined", filename: "http://localhost:3000/assets/js/eventsource.sharedworker.js", lineno: 1, colno: 85, srcElement: SharedWorker, eventPhase: 0, bubbles: false, cancelable: true, defaultPrevented: false }  
index.js:37:15714
18:25:45.836 error { target: SharedWorker, isTrusted: true, message: "ReferenceError: EventSource is not defined", filename: "http://localhost:3000/assets/js/eventsource.sharedworker.js", lineno: 1, colno: 85, srcElement: SharedWorker, eventPhase: 0, bubbles: false, cancelable: true, defaultPrevented: false }  
index.js:58:1724
18:25:45.837 error { target: SharedWorker, isTrusted: true, message: "ReferenceError: EventSource is not defined", filename: "http://localhost:3000/assets/js/eventsource.sharedworker.js", lineno: 1, colno: 85, srcElement: SharedWorker, eventPhase: 0, bubbles: false, cancelable: true, defaultPrevented: false }  
index.js:37:15714

Actually, downgrading to 1.16.9 I still have the error, but only in the developer console not in the UI. As a workaround, I can add

[ui.notification]
EVENT_SOURCE_UPDATE_TIME = -1

to my app.ini, but EVENT_SOURCE_UPDATE_TIME's documentation seems to suggest that the feature availability is auto-detected. (If I type EventSource into devconsole, I get back that it's a function, I don't know what gitea does to get it undefined...)

Screenshots

This is running gitea locally, but I get the same result on try.gitea.org.
a

Gitea Version

1.17.0

Can you reproduce the bug on the Gitea demo site?

Yes

Operating System

Linux

Browser Version

Pale Moon 31.1.1

Originally created by @u3shit on GitHub (Jul 31, 2022). ### Description After updating to 1.17.0 with javascript enabled this time, after logging in I start getting errors about EventSource (see screenshot). (It doesn't happen when I'm logged out) Developer console: ``` 18:25:45.836 error { target: SharedWorker, isTrusted: true, message: "ReferenceError: EventSource is not defined", filename: "http://localhost:3000/assets/js/eventsource.sharedworker.js", lineno: 1, colno: 85, srcElement: SharedWorker, eventPhase: 0, bubbles: false, cancelable: true, defaultPrevented: false } index.js:58:1724 ev/< http://localhost:3000/assets/js/index.js:58:1724 18:25:45.836 error { target: SharedWorker, isTrusted: true, message: "ReferenceError: EventSource is not defined", filename: "http://localhost:3000/assets/js/eventsource.sharedworker.js", lineno: 1, colno: 85, srcElement: SharedWorker, eventPhase: 0, bubbles: false, cancelable: true, defaultPrevented: false } index.js:37:15714 18:25:45.836 error { target: SharedWorker, isTrusted: true, message: "ReferenceError: EventSource is not defined", filename: "http://localhost:3000/assets/js/eventsource.sharedworker.js", lineno: 1, colno: 85, srcElement: SharedWorker, eventPhase: 0, bubbles: false, cancelable: true, defaultPrevented: false } index.js:58:1724 18:25:45.837 error { target: SharedWorker, isTrusted: true, message: "ReferenceError: EventSource is not defined", filename: "http://localhost:3000/assets/js/eventsource.sharedworker.js", lineno: 1, colno: 85, srcElement: SharedWorker, eventPhase: 0, bubbles: false, cancelable: true, defaultPrevented: false } index.js:37:15714 ``` Actually, downgrading to 1.16.9 I still have the error, but only in the developer console not in the UI. As a workaround, I can add ``` [ui.notification] EVENT_SOURCE_UPDATE_TIME = -1 ``` to my `app.ini`, but `EVENT_SOURCE_UPDATE_TIME`'s documentation seems to suggest that the feature availability is auto-detected. (If I type `EventSource` into devconsole, I get back that it's a `function`, I don't know what gitea does to get it undefined...) ### Screenshots This is running gitea locally, but I get the same result on try.gitea.org. ![a](https://user-images.githubusercontent.com/17014489/182036107-bceb766b-0557-46a7-8164-0721de848a96.png) ### Gitea Version 1.17.0 ### Can you reproduce the bug on the Gitea demo site? Yes ### Operating System Linux ### Browser Version Pale Moon 31.1.1
GiteaMirror added the topic/uitype/bug labels 2025-11-02 08:34:32 -06:00
Author
Owner

@6543 commented on GitHub (Jul 31, 2022):

did you clean browser cache?

@6543 commented on GitHub (Jul 31, 2022): did you clean browser cache?
Author
Owner

@u3shit commented on GitHub (Jul 31, 2022):

I tried it in a new clean profile, same result.

@u3shit commented on GitHub (Jul 31, 2022): I tried it in a new clean profile, same result.
Author
Owner

@zeripath commented on GitHub (Jul 31, 2022):

Looks like the PaleMoon browser doesn't have the EventSource in its SharedWorker although it does have it in the non-sharedworker state.

There are a few places we would need to look at to get this working:

589677fafb/web_src/js/features/notification.js (L52-L53)

This would need to detect somehow that EventSource is not available in the SharedWorker, or better we would need to protect the constructor here to test if the source is extant:

589677fafb/web_src/js/features/eventsource.sharedworker.js (L7)

and then the sharedworker dropped.


Now, I don't think we explicitly support Palemoon.

@zeripath commented on GitHub (Jul 31, 2022): Looks like the PaleMoon browser doesn't have the EventSource in its SharedWorker although it does have it in the non-sharedworker state. There are a few places we would need to look at to get this working: https://github.com/go-gitea/gitea/blob/589677fafb4b77112b7220a1c6089cec71d6db94/web_src/js/features/notification.js#L52-L53 This would need to detect somehow that EventSource is not available in the SharedWorker, or better we would need to protect the constructor here to test if the source is extant: https://github.com/go-gitea/gitea/blob/589677fafb4b77112b7220a1c6089cec71d6db94/web_src/js/features/eventsource.sharedworker.js#L7 and then the sharedworker dropped. --- Now, I don't think we explicitly support Palemoon.
Author
Owner

@lunny commented on GitHub (Aug 1, 2022):

Before 1.17, your javascript error will be hidden by webbrowser. In 1.17, they will be displayed on the top of the page.

@lunny commented on GitHub (Aug 1, 2022): Before 1.17, your javascript error will be hidden by webbrowser. In 1.17, they will be displayed on the top of the page.
Author
Owner

@veita commented on GitHub (Aug 2, 2022):

Before 1.17, your javascript error will be hidden by webbrowser. In 1.17, they will be displayed on the top of the page.

What is the rationale behind this? The update renders the page quite useless.

grafik

@veita commented on GitHub (Aug 2, 2022): > Before 1.17, your javascript error will be hidden by webbrowser. In 1.17, they will be displayed on the top of the page. What is the rationale behind this? The update renders the page quite useless. ![grafik](https://user-images.githubusercontent.com/419665/182448279-927bf2de-04f2-4add-b83a-527199411029.png)
Author
Owner

@delvh commented on GitHub (Aug 2, 2022):

This issue is a prime example as to why:
Previously, these errors existed as well, but they were silently ignored.
Now, they are reported.
Hence, they can be fixed.
Also, there is a second benefit: Users can see why something failed and don't have to think "What a stupid site, nothing is happening?"

The update renders the page quite useless

Why that?
You can still scroll, right?

@delvh commented on GitHub (Aug 2, 2022): This issue is a prime example as to why: Previously, these errors existed as well, but they were silently ignored. Now, they are reported. Hence, they can be fixed. Also, there is a second benefit: Users can see why something failed and don't have to think "What a stupid site, nothing is happening?" > The update renders the page quite useless Why that? You can still scroll, right?
Author
Owner

@wxiaoguang commented on GitHub (Aug 3, 2022):

FYI, some questions can be answered from #18971 and (https://github.com/go-gitea/gitea/pull/18971#issuecomment-1158973862)

There are some FAQs like "What if some users do not want to see these errors?" and "What if I see JavaScript error", and it's always open to propose better solutions.

@wxiaoguang commented on GitHub (Aug 3, 2022): FYI, some questions can be answered from #18971 and (https://github.com/go-gitea/gitea/pull/18971#issuecomment-1158973862) * #18971 There are some FAQs like "What if some users do not want to see these errors?" and "What if I see JavaScript error", and it's always open to propose better solutions.
Author
Owner

@wxiaoguang commented on GitHub (Aug 4, 2022):

Please have a try on try.gitea.io

If the problem is fixed, I will send a backport to 1.17.1

@wxiaoguang commented on GitHub (Aug 4, 2022): Please have a try on try.gitea.io If the problem is fixed, I will send a backport to 1.17.1
Author
Owner

@u3shit commented on GitHub (Aug 4, 2022):

Checked, no errors reported (neither on the page, nor in javasscript console)

@u3shit commented on GitHub (Aug 4, 2022): Checked, no errors reported (neither on the page, nor in javasscript console)
Author
Owner

@wxiaoguang commented on GitHub (Aug 4, 2022):

Thank you for the confirmation. The backport for 1.17 is in https://github.com/go-gitea/gitea/pull/20663

@wxiaoguang commented on GitHub (Aug 4, 2022): Thank you for the confirmation. The backport for 1.17 is in https://github.com/go-gitea/gitea/pull/20663 * https://github.com/go-gitea/gitea/pull/20663
Author
Owner

@wolfbeast commented on GitHub (Aug 19, 2022):

Unfortunately 1.17.1 doesn't seem to fix this error. I just upgraded our Pale Moon Gitea instance to it and it still throws.

22:23:58.501 worker error error { target: SharedWorker, isTrusted: true, message: "ReferenceError: EventSource is not defined", filename: "https://repo.palemoon.org/assets/js/eventsource.sharedworker.js", lineno: 1, colno: 85, srcElement: SharedWorker, eventPhase: 0, bubbles: false, cancelable: true, defaultPrevented: false } 1 index.js:37:15854
Gg/< https://repo.palemoon.org/assets/js/index.js:37:15854

@wolfbeast commented on GitHub (Aug 19, 2022): Unfortunately 1.17.1 doesn't seem to fix this error. I just upgraded our Pale Moon Gitea instance to it and it still throws. > 22:23:58.501 worker error error { target: SharedWorker, isTrusted: true, message: "ReferenceError: EventSource is not defined", filename: "https://repo.palemoon.org/assets/js/eventsource.sharedworker.js", lineno: 1, colno: 85, srcElement: SharedWorker, eventPhase: 0, bubbles: false, cancelable: true, defaultPrevented: false } 1 index.js:37:15854 Gg/< https://repo.palemoon.org/assets/js/index.js:37:15854
Author
Owner

@zeripath commented on GitHub (Aug 19, 2022):

Works for me on try.gitea.io.

Have you cleared your cache after starting 1.17.1?

@zeripath commented on GitHub (Aug 19, 2022): Works for me on try.gitea.io. Have you cleared your cache after starting 1.17.1?
Author
Owner

@wolfbeast commented on GitHub (Aug 19, 2022):

🤦 OK, silly me. Caching issue. Sorry for the noise!

@wolfbeast commented on GitHub (Aug 19, 2022): 🤦 OK, silly me. Caching issue. Sorry for the noise!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9298