go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
45.16k stars 5.49k forks source link

TypeError: window.customElements is undefined after update to 1.19.0 #23590

Closed veita closed 1 year ago

veita commented 1 year ago

Description

After update from 1.18.5 to 1.19.0 the following error is displayed on top of every page.

JavaScript error: TypeError: window.customElements is undefined (https://g.nezwerg.de/assets/js/webcomponents.js?v=1.19.0 @ 1:35). Open browser console to see more details.

Browser console

<anonymous> https://gitea.example.org/assets/js/webcomponents.js:1:35
<anonymous> https://gitea.example.org/assets/js/webcomponents.js:1:2

Is it safe to switch back to 1.18.5?

Gitea Version

1.19.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.30.2

Operating System

Debian

How are you running Gitea?

Gitea downloaded from https://github.com/go-gitea/gitea/releases/download/v1.19.0/gitea-1.19.0-linux-amd64

Database

PostgreSQL

lunny commented 1 year ago

Please clear the browser cache and try again.

wxiaoguang commented 1 year ago

What's your browser version? I guess your browser is too old.

https://caniuse.com/custom-elementsv1 (it's widely supported after 2017~2019)


If there are too many users using browsers without customElements support, maybe we need to polyfill customElements

wxiaoguang commented 1 year ago

If you could built your own binary, could you try #23592 ?

Or, could you try to use custom templates:

u3shit commented 1 year ago

@wxiaoguang Pale Moon is unfortunately missing from caniuse data (while it has 3 columns for desktop chromium forks and 2 browsers that received no updates in 8 years...), and it still doesn't have a complete customElements implementation: https://repo.palemoon.org/MoonchildProductions/UXP/issues/2135 The head.tmpl workaround fixes the problem for me.

wxiaoguang commented 1 year ago

No worry, #23595 will fix it. It also reminds me to think more about browsers.

wxiaoguang commented 1 year ago

Update: since #23595 has been merged, you could try to get latest 1.19 from https://dl.gitea.com/gitea/1.19/ , it should contains the fix, then you do not need to use the workaround.