mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-09 12:46:42 -05:00
JavaScript error: RangeError: invalid value unit for option style #11459
Closed
opened 2025-11-02 09:38:25 -06:00 by GiteaMirror
·
18 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
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1.4.0-rc1
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#11459
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @veita on GitHub (Aug 15, 2023).
Description
Visit https://gitea.example.org/admin. The following error is shown on a red bar on the webpage:
Gitea Version
1.20.2
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
git version 2.39.2
Operating System
Debian 12 Bookworm
How are you running Gitea?
Gitea binary downloaded from https://github.com/go-gitea/gitea/releases/download/ and run as a Systemd service.
Browser: Pale Moon 32.3.1.
Database
PostgreSQL
@silverwind commented on GitHub (Aug 15, 2023):
Can you show a screenshot of the surrounding JS code when you click the error line number in the browser console (F12)?
@wxiaoguang commented on GitHub (Aug 15, 2023):
The exception is thrown here:
d0da95b8c6/src/duration-format-ponyfill.ts (L113)What's your browser name/versionand what's your locale (eg: runwindow.document.documentElement.langin your browser console)?(Hmm, I see Browser: Pale Moon 32.3.1, maybe it's a browser's bug)
And, are you using some browser plugins like translators? Does the error still exist in private window?
@wxiaoguang commented on GitHub (Aug 16, 2023):
PaleMoon bug (incomplete
Intl.NumberFormatsupport).You could test it on this page https://github.github.io/relative-time-element/examples/ and fix the bug accordingly.
@veita commented on GitHub (Aug 16, 2023):
https://repo.palemoon.org/MoonchildProductions/Pale-Moon/issues/1930
@wolfbeast commented on GitHub (Aug 18, 2023):
It's not necessarily a "bug", it's just "yet another spec change" and "yet another tacked on API". We did lift our
Intlsupport to the proper level recently, however we do not yet support the so-calledUnified NumberFormat APIwhich Gitea apparently now wants to use. i.e. not a bug, just another feature we'll have to implement.Couldn't this have been implemented a bit more browser-agnostic in Gitea? I mean, not like "relative date formats" are a new thing, at all.
@wxiaoguang commented on GitHub (Aug 18, 2023):
Before 1.20: the "relative date" is rendered by backend, it doesn't support i18n well.
1.20: by using GitHub's "relative-time" element (#23988) , most date/time/duration texts are rendered by browser.
@wolfbeast commented on GitHub (Aug 18, 2023):
Would you consider keeping the backend implementation as a fallback, at least? I mean, just hard throwing an error is always worse than "not supporting i18n well".
(as an aside, GitHub has indicated they want to always be on the bleeding edge of new client APIs, so using that as a reference for "what to implement" may not always be a good idea...)
@wxiaoguang commented on GitHub (Aug 18, 2023):
I am neutral for it, but I am not familiar with the "relative-time" change. Maybe the original author @yardenshoham could suggest.
@wolfbeast commented on GitHub (Aug 18, 2023):
For the record, GitHub's relative duration implementation does seem to render correctly in Pale Moon.
@wxiaoguang commented on GitHub (Aug 18, 2023):
Maybe they use some internal packages or they use some polyfill packages.
@yardenshoham commented on GitHub (Aug 18, 2023):
Perhaps we could add some sort of polyfill for the missing NumberFormat API? I see a backend implementation as a step back in terms of evolution
@wxiaoguang commented on GitHub (Aug 18, 2023):
Just get an (somewhat strange) idea, would PaleMoon like to pack some polyfill packages by default? Then many browser features could be used out-of-box, instead of waiting for a C++ native implemention. 😁
@wolfbeast commented on GitHub (Aug 18, 2023):
That's rather complex and potentially dangerous as we can't just inject scripts into content willy-nilly, especially not if they are part of the browser's internal resources (it breaks the chrome/content boundary); on top, blanked polyfilling will conflict with other websites that may polyfill things themselves. In isolation it might be a good idea but not on the open web, unfortunately. We have an open issue to implement this API now, but no immediate timeline as to when we'll get to it.
@wxiaoguang commented on GitHub (Aug 18, 2023):
Made some tests, the minimal polyfill is like this (without i18n support):
@wxiaoguang commented on GitHub (Aug 18, 2023):
Add minimum polyfill to support "relative-time-element" in PaleMoon #26575
Does it look good or could there be better solutions?
@yardenshoham commented on GitHub (Aug 18, 2023):
How about https://formatjs.io/docs/polyfills/intl-numberformat/?
@wxiaoguang commented on GitHub (Aug 18, 2023):
See the FAQ in #26575
@yardenshoham commented on GitHub (Aug 18, 2023):
I implemented https://formatjs.io/docs/polyfills/intl-numberformat/ with all locales, you are right the size will go from 60KB to 3MB, I wanted to only load the needed locale but that requires dynamic import which is asynchronous but we need it before we register the web component... Also we can't register the web component after the locale load because the HTML already has the
relative-time