mirror of
https://github.com/go-gitea/gitea.git
synced 2026-07-15 20:09:18 -05:00
index.css does not match index.css.map #5785
Closed
opened 2025-11-02 06:35:53 -06:00 by GiteaMirror
·
19 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
v1.16.1
v1.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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
No Label
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#5785
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 @CL-Jeremy on GitHub (Jul 25, 2020).
a3afb88f1b[x]):Description
This is related to #11997.
It might be my fault to have failed to understand how exactly the build system works, or even be a bug somewhere in the toolchain, but the content of
/public/css/index.cssdoes not match/public/css/index.css.map.This is tested multiple times, even after a complete rebuild using
git clean -xdf --exclude=node_modules/* .followed byTAGS="bindata" make build.In particular, I moved
sans-serifto the end of the font stacks in the function.override-fonts, which emerged ind78bb1d564and worked fine up till 1.11.x. Going through both files shows that the function does not resolve into what it was before (compareindex.css.maporindex.cssfrom any version between 1.9.x and 1.11.x by searching for:langor so).Screenshots
(It does involve the web interface, but you could probably check https://mikeslab.dix.asia/gitea/CL-Jeremy/gitea/pulls/1).
@silverwind commented on GitHub (Jul 25, 2020):
I can only imagine this being a bug in either cssnano-webpack-plugin or cssnano. The former was switched from optimize-css-assets-webpack-plugin specifically because of better source map support.
@CL-Jeremy commented on GitHub (Jul 26, 2020):
I’ve just tested and it appeared already in #9983. It’s not the fact that the source map was any wrong, but rather correct whereas the actual CSS is faulty. Can’t imagine how that could happen since the translator is the same, isn’t it? And if cssnano were to blame, how come it didn’t happen earlier (the commit right before that PR was alright FYI)?
@silverwind commented on GitHub (Jul 26, 2020):
Can you try with
ui.USE_SERVICE_WORKER = false? Thought highly unlikely it has any effect, I just want to ensure this is not a serviceworker cache issue (I think those are not totally resolved yet).@CL-Jeremy commented on GitHub (Jul 26, 2020):
I wasn’t actually talking about the result, but the actual files generated in the build directory. The resulting static file was already different after #9983. Now the fact a CSS file mismatches the source map is another weird thing.
But if you mean serviceworker would generate something else that shadows
index.css, then it becomes even weirder...Edit: added the setting. Effective rules do not change (as expected). And double-checked the static files are freshly generated each time.
Just tested again, and it’s indeed a bug somewhere in the translation. Swapping
@default-fontsagainst any other expressions (e.g.Test, @monospaced-fonts, 'A B C') in the:langblocks would resolve correctly.Edit 2: something very curious happened when I do
make clean-all && make generate: the mixins seem read from some cache and unifies the results, giving (at global scope) something like:with
NB: this is all tested with detached HEAD at
1019913ea.@CL-Jeremy commented on GitHub (Jul 26, 2020):
I did a quick
grep -rl -- '-apple-system' .and the result (after removing it from_base.less) was:Any chance they could do anything strange here? I believe none of the above actually comes from #9983.
@silverwind commented on GitHub (Jul 26, 2020):
No, that's not possible. I was just thinking maybe it was serving a cached asset before your change but I'm pretty sure cache invalidation is working correctly for it and
.mapfiles are probable not even cached by the worker.@silverwind commented on GitHub (Jul 26, 2020):
I think it's more likely you've hit some bug in the Less source map generation. I want to move off Less variables to CSS variables for the fonts (https://github.com/go-gitea/gitea/issues/11045) which may fix that situation.
@silverwind commented on GitHub (Aug 17, 2020):
Is this still an issue? We've now switched to the new css-minimizer-webpack-plugin and I personally have not noticed any issue with its sourcemaps.
@CL-Jeremy commented on GitHub (Aug 17, 2020):
I'll take a look. Running this on my own web server takes almost forever (screenshot from the version referred to in this issue, just fired up), but I don't want to test it locally...

@silverwind commented on GitHub (Aug 17, 2020):
200s template emission time? Something is definitely wrong there, nevery seen anything like it.
@CL-Jeremy commented on GitHub (Aug 17, 2020):
No, 28.4s (but still remarkable). This is mainly due to some SSD configuration of my VPS I believe. CPU is constantly at 100% upon starting gitea for around 3 minutes...
@silverwind commented on GitHub (Aug 17, 2020):
Certainly strange. Maybe related to https://github.com/go-gitea/gitea/issues/7910. If the VPS still has enough resources left, maybe some of the golang debugging tools like pprof could help debug these issues.
@CL-Jeremy commented on GitHub (Aug 17, 2020):
Yeah, compared to Gogs on the same server, Gitea is at least 50% slower. I'm limiting the resources using cgroups, though. Have seen too many occasions where things get OOM-killed, and that single-core CPU is very precious for the handful of services I keep there (JVM and Node.js are both famous resource hoggers).
@CL-Jeremy commented on GitHub (Aug 17, 2020):
No dice. Still the same thing. As long as this mixin is used as it is right now, it would always go in that way.
I still suspect the problem happens in webpack less compiler itself somehow. I don't know the lifecycle, though.
@silverwind commented on GitHub (Aug 18, 2020):
Can this be reproduced on https://try.gitea.io? For example if I view the font definitions in Chrome:
Clicking the line number seems to correctly show the Less source:
@CL-Jeremy commented on GitHub (Aug 18, 2020):
You have just proven my point. The definition is:
Yet the result is:
Apart from the comma before
sans-serif, this still doesn't add up. Where do Ubuntu and Cantarell come from? Certainly not from semantic.@CL-Jeremy commented on GitHub (Aug 18, 2020):
Damn, I see where it comes from:

@CL-Jeremy commented on GitHub (Aug 18, 2020):
Not sure if this is idiomatic but it's working now:
@silverwind commented on GitHub (Aug 18, 2020):
Ah, I wasn't aware of that
postcss-preset-envdid that, nice find. Seems resonable we disable that, it's a unnecessary transform.