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.02k stars 5.49k forks source link

Build success but all assets are empty #23850

Closed yp05327 closed 1 year ago

yp05327 commented 1 year ago

Description

If you use Dockerfile to build a image, you will get same result.

Gitea Version

latest

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

build

Database

None

silverwind commented 1 year ago

Please show webpack output from make watch, or run only webpack via make watch-frontend.

yp05327 commented 1 year ago
Logs ``` bash make watch-frontend rm -rf public/js public/css public/fonts public/img/webpack public/serviceworker.js NODE_ENV=development npx webpack --watch --progress hidden assets 919 KiB 82 assets assets by path . 39.2 MiB assets by path js/*.js 37 MiB asset js/-.ac56fb3e.js 776 KiB [emitted] [immutable] (name: -) (id hint: vendors) asset js/asciinema-player.d1ee0d36.js 188 KiB [emitted] [immutable] (name: asciinema-player) (id hint: vendors) asset js/citation-js-bibtex.abba4ca5.js 137 KiB [emitted] [immutable] (name: citation-js-bibtex) (id hint: vendors) asset js/citation-js-core-citation-js-formats-citation-js-bibtex-citation-js-csl.57d74e29.js 212 KiB [emitted] [immutable] (name: citation-js-core-citation-js-formats-citation-js-bibtex-citation-js-csl) (id hint: vendors) asset js/citation-js-csl.352d4d20.js 1.1 MiB [emitted] [immutable] (name: citation-js-csl) (id hint: vendors) asset js/citation-js-formats.90f968df.js 164 KiB [emitted] [immutable] (name: citation-js-formats) (id hint: vendors) asset js/dropzone.6d226004.js 101 KiB [emitted] [immutable] (name: dropzone) (id hint: vendors) asset js/easymde.3f2aa369.js 714 KiB [emitted] [immutable] (name: easymde) (id hint: vendors) asset js/eventsource.sharedworker.js 4.25 KiB [emitted] (name: eventsource.sharedworker) asset js/index.js 2.96 MiB [emitted] (name: index) 1 related asset asset js/katex.0e08dbcd.js 591 KiB [emitted] [immutable] (name: katex) (id hint: vendors) asset js/mcaptcha-vanilla-glue.4cad38b0.js 3.75 KiB [emitted] [immutable] (name: mcaptcha-vanilla-glue) asset js/mermaid.e34741a6.js 1.88 MiB [emitted] [immutable] (name: mermaid) (id hint: vendors) asset js/minicolors.99b69665.js 36.3 KiB [emitted] [immutable] (name: minicolors) (id hint: vendors) asset js/monaco-css.08c8aaf4.worker.js 1.88 MiB [emitted] asset js/monaco-editor.a85ce25e.worker.js 718 KiB [emitted] asset js/monaco-html.592e57e2.worker.js 1.34 MiB [emitted] asset js/monaco-json.13d55dcf.worker.js 979 KiB [emitted] asset js/monaco-ts.5efaced7.worker.js 8.67 MiB [emitted] asset js/monaco.750d74af.js 9.03 MiB [emitted] [immutable] (name: monaco) (id hint: vendors) asset js/node_modules_mermaid_dist_classDiagram-4456d403_js.94433865.js 8.73 KiB [emitted] [immutable] asset js/node_modules_mermaid_dist_classDiagram-v2-539b00ca_js.229c7bb5.js 12.4 KiB [emitted] [immutable] asset js/node_modules_mermaid_dist_errorDiagram-bb949655_js.abcc79aa.js 1.81 KiB [emitted] [immutable] asset js/node_modules_mermaid_dist_flowDiagram-v2-4c9a7611_js.f4a8bafc.js 3.45 KiB [emitted] [immutable] asset js/sortable.619b7be8.js 115 KiB [emitted] [immutable] (name: sortable) (id hint: vendors) asset js/swagger.js 1 MiB [emitted] (name: swagger) asset js/theme-arc-green.js 1.03 KiB [emitted] (name: theme-arc-green) asset js/theme-auto.js 1.01 KiB [emitted] (name: theme-auto) asset js/tribute.24daad8a.js 30.3 KiB [emitted] [immutable] (name: tribute) (id hint: vendors) asset js/vendors-node_modules_mermaid_dist_c4Diagram-f9e67060_js.56aa8b2a.js 118 KiB [emitted] [immutable] (id hint: vendors) asset js/vendors-node_modules_mermaid_dist_erDiagram-25977acd_js.45c0d2bc.js 509 KiB [emitted] [immutable] (id hint: vendors) asset js/vendors-node_modules_mermaid_dist_flowDiagram-42bb1e4d_js.bbef1588.js 76 KiB [emitted] [immutable] (id hint: vendors) asset js/vendors-node_modules_mermaid_dist_flowchart-elk-definition-c9fc5e04_js.c68ee616.js 1.64 MiB [emitted] [immutable] (id hint: vendors) asset js/vendors-node_modules_mermaid_dist_ganttDiagram-41439120_js.54ad604f.js 71.8 KiB [emitted] [immutable] (id hint: vendors) asset js/vendors-node_modules_mermaid_dist_gitGraphDiagram-30dcca6d_js.2e20879d.js 69.4 KiB [emitted] [immutable] (id hint: vendors) asset js/vendors-node_modules_mermaid_dist_infoDiagram-1b335302_js.1984b095.js 19.8 KiB [emitted] [immutable] (id hint: vendors) asset js/vendors-node_modules_mermaid_dist_journeyDiagram-ded66ec9_js.ff1fa58e.js 45.3 KiB [emitted] [immutable] (id hint: vendors) asset js/vendors-node_modules_mermaid_dist_mindmap-definition-c8a05b8a_js.31922ed0.js 1.15 MiB [emitted] [immutable] (id hint: vendors) asset js/vendors-node_modules_mermaid_dist_pieDiagram-905ac727_js.e507bf99.js 30.9 KiB [emitted] [immutable] (id hint: vendors) asset js/vendors-node_modules_mermaid_dist_requirementDiagram-84e9ae78_js.8ec5c444.js 494 KiB [emitted] [immutable] (id hint: vendors) asset js/vendors-node_modules_mermaid_dist_sequenceDiagram-2c95880e_js.02e7879b.js 136 KiB [emitted] [immutable] (id hint: vendors) asset js/vendors-node_modules_mermaid_dist_stateDiagram-95825141_js.989ff398.js 25.5 KiB [emitted] [immutable] (id hint: vendors) asset js/vendors-node_modules_mermaid_dist_stateDiagram-v2-1cc5d8ed_js.6f7bb6fa.js 14.6 KiB [emitted] [immutable] (id hint: vendors) asset js/vendors-node_modules_mermaid_dist_timeline-definition-24ebf147_js.e47bae62.js 48 KiB [emitted] [immutable] (id hint: vendors) asset js/webcomponents.js 21.6 KiB [emitted] (name: webcomponents) assets by path fonts/ 491 KiB asset fonts/KaTeX_AMS-Regular.73ea273a.woff2 27.4 KiB [emitted] [immutable] [from: node_modules/katex/dist/fonts/KaTeX_AMS-Regular.woff2] (auxiliary name: katex) (auxiliary id hint: vendors) asset fonts/KaTeX_Caligraphic-Bold.a1abf90d.woff2 6.75 KiB [emitted] [immutable] [from: node_modules/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff2] (auxiliary name: katex) (auxiliary id hint: vendors) asset fonts/KaTeX_Caligraphic-Regular.d6484fce.woff2 6.75 KiB [emitted] [immutable] [from: node_modules/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff2] (auxiliary name: katex) (auxiliary id hint: vendors) asset fonts/KaTeX_Fraktur-Bold.931d67ea.woff2 11.1 KiB [emitted] [immutable] [from: node_modules/katex/dist/fonts/KaTeX_Fraktur-Bold.woff2] (auxiliary name: katex) (auxiliary id hint: vendors) asset fonts/KaTeX_Fraktur-Regular.172d3529.woff2 11.1 KiB [emitted] [immutable] [from: node_modules/katex/dist/fonts/KaTeX_Fraktur-Regular.woff2] (auxiliary name: katex) (auxiliary id hint: vendors) asset fonts/KaTeX_Main-Bold.39890742.woff2 24.7 KiB [emitted] [immutable] [from: node_modules/katex/dist/fonts/KaTeX_Main-Bold.woff2] (auxiliary name: katex) (auxiliary id hint: vendors) asset fonts/KaTeX_Main-BoldItalic.20f389c4.woff2 16.4 KiB [emitted] [immutable] [from: node_modules/katex/dist/fonts/KaTeX_Main-BoldItalic.woff2] (auxiliary name: katex) (auxiliary id hint: vendors) asset fonts/KaTeX_Main-Italic.fe2176f7.woff2 16.6 KiB [emitted] [immutable] [from: node_modules/katex/dist/fonts/KaTeX_Main-Italic.woff2] (auxiliary name: katex) (auxiliary id hint: vendors) asset fonts/KaTeX_Main-Regular.f650f111.woff2 25.7 KiB [emitted] [immutable] [from: node_modules/katex/dist/fonts/KaTeX_Main-Regular.woff2] (auxiliary name: katex) (auxiliary id hint: vendors) asset fonts/KaTeX_Math-BoldItalic.dcbcbd93.woff2 16 KiB [emitted] [immutable] [from: node_modules/katex/dist/fonts/KaTeX_Math-BoldItalic.woff2] (auxiliary name: katex) (auxiliary id hint: vendors) asset fonts/KaTeX_Math-Italic.6d3d25f4.woff2 16.1 KiB [emitted] [immutable] [from: node_modules/katex/dist/fonts/KaTeX_Math-Italic.woff2] (auxiliary name: katex) (auxiliary id hint: vendors) asset fonts/KaTeX_SansSerif-Bold.95591a92.woff2 11.9 KiB [emitted] [immutable] [from: node_modules/katex/dist/fonts/KaTeX_SansSerif-Bold.woff2] (auxiliary name: katex) (auxiliary id hint: vendors) asset fonts/KaTeX_SansSerif-Italic.7d393d38.woff2 11.7 KiB [emitted] [immutable] [from: node_modules/katex/dist/fonts/KaTeX_SansSerif-Italic.woff2] (auxiliary name: katex) (auxiliary id hint: vendors) asset fonts/KaTeX_SansSerif-Regular.cd5e231e.woff2 10.1 KiB [emitted] [immutable] [from: node_modules/katex/dist/fonts/KaTeX_SansSerif-Regular.woff2] (auxiliary name: katex) (auxiliary id hint: vendors) asset fonts/KaTeX_Script-Regular.c81d1b2a.woff2 9.42 KiB [emitted] [immutable] [from: node_modules/katex/dist/fonts/KaTeX_Script-Regular.woff2] (auxiliary name: katex) (auxiliary id hint: vendors) asset fonts/KaTeX_Size1-Regular.6eec866c.woff2 5.34 KiB [emitted] [immutable] [from: node_modules/katex/dist/fonts/KaTeX_Size1-Regular.woff2] (auxiliary name: katex) (auxiliary id hint: vendors) asset fonts/KaTeX_Size2-Regular.2960900c.woff2 5.09 KiB [emitted] [immutable] [from: node_modules/katex/dist/fonts/KaTeX_Size2-Regular.woff2] (auxiliary name: katex) (auxiliary id hint: vendors) asset fonts/KaTeX_Size3-Regular.e1951519.woff2 3.54 KiB [emitted] [immutable] [from: node_modules/katex/dist/fonts/KaTeX_Size3-Regular.woff2] (auxiliary name: katex) (auxiliary id hint: vendors) asset fonts/KaTeX_Size4-Regular.e418bf25.woff2 4.81 KiB [emitted] [immutable] [from: node_modules/katex/dist/fonts/KaTeX_Size4-Regular.woff2] (auxiliary name: katex) (auxiliary id hint: vendors) asset fonts/KaTeX_Typewriter-Regular.c295e7f7.woff2 13.3 KiB [emitted] [immutable] [from: node_modules/katex/dist/fonts/KaTeX_Typewriter-Regular.woff2] (auxiliary name: katex) (auxiliary id hint: vendors) asset fonts/codicon.7064e66c.ttf 71.2 KiB [emitted] [immutable] [from: node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf] (auxiliary name: monaco) (auxiliary id hint: vendors) asset fonts/fontawesome-webfont.20fd1704.woff2 75.4 KiB [emitted] [immutable] [from: node_modules/font-awesome/fonts/fontawesome-webfont.woff2?v=4.7.0] (auxiliary name: index) asset fonts/icons.9451d5fe.woff2 77.6 KiB [emitted] [immutable] [from: web_src/fomantic/build/themes/default/assets/fonts/icons.woff2] (auxiliary name: index) asset fonts/outline-icons.c5240512.woff2 13.3 KiB [emitted] [immutable] [from: web_src/fomantic/build/themes/default/assets/fonts/outline-icons.woff2] (auxiliary name: index) assets by path css/*.css 1.54 MiB asset css/asciinema-player.179a89d9.css 51.9 KiB [emitted] [immutable] (name: asciinema-player) (id hint: vendors) asset css/dropzone.23a3e85e.css 5.01 KiB [emitted] [immutable] (name: dropzone) (id hint: vendors) asset css/index.css 1.09 MiB [emitted] (name: index) 1 related asset asset css/katex.5825c9ee.css 26.7 KiB [emitted] [immutable] (name: katex) (id hint: vendors) asset css/minicolors.f715c569.css 10.3 KiB [emitted] [immutable] (name: minicolors) (id hint: vendors) asset css/monaco.b2d04c71.css 192 KiB [emitted] [immutable] (name: monaco) (id hint: vendors) asset css/swagger.css 143 KiB [emitted] (name: swagger) asset css/theme-arc-green.css 14.3 KiB [emitted] (name: theme-arc-green) asset css/theme-auto.css 14.8 KiB [emitted] (name: theme-auto) asset img/webpack/jquery.minicolors.0e614115.png 67 KiB [emitted] [immutable] [from: node_modules/@claviska/jquery-minicolors/jquery.minicolors.png] (auxiliary name: minicolors) (auxiliary id hint: vendors) asset serviceworker.js 168 KiB [emitted] (name: serviceworker) webpack 5.76.2 compiled successfully in 7270 ms ```
wxiaoguang commented 1 year ago

Will be fixed by #23844

silverwind commented 1 year ago

Webpack output looks good. These files should be served by the public module in dev mode, maybe debug there.

Will be fixed by https://github.com/go-gitea/gitea/pull/23844

I don't see how that PR could be related.

wxiaoguang commented 1 year ago

I don't see how that PR could be related.

opts.CorsHandler = nil => corsSent = false => return

silverwind commented 1 year ago

Interesting, I wonder why I didn't hit the issue. Probably some configuration difference.

wxiaoguang commented 1 year ago

Interesting, I wonder why I didn't hit the issue. Probably some configuration thing then.

That's a regression bug introduced by #23495. When I was writing #23495, the old code looked difficult to understand, so I rewrote it, but the edge case opts.CorsHandler = nil was never triggered during test.