我在开发环境中经常遇到这些错误:
discourse-reactions_main.Q5vqJe-h8ro1ilp.digested.js:1 Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH
chunk-jiiahumh.digested.js:1 Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH
chunk-mkia0op3.digested.js:1 Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH
或者:
GET http://localhost:3000/assets/js/plugins/chat_main.DXNPoW-htkfwtbk.digested.js net::ERR_CONTENT_LENGTH_MISMATCH 200 (OK)
(index):90 GET http://localhost:3000/assets/js/plugins/discourse-ai_admin.DncC-f-mtqe97w7.digested.js net::ERR_CONTENT_LENGTH_MISMATCH 200 (OK)
(index):541 GET http://localhost:3000/stylesheets/admin_c962958770e1245d5bb1026e1e40f1ef3ef611f6.css?__ws=localhost net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK)
(index):545 GET http://localhost:3000/stylesheets/chat_c962958770e1245d5bb1026e1e40f1ef3ef611f6.css?__ws=localhost net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK)
color_definitions_dark_13_-1_2507ff89a2ca761acdb701533aca3014e900a7a0.css?__ws=localhost:1 GET http://localhost:3000/fonts/InterVariable.woff2?v=0.0.19 net::ERR_CONTENT_LENGTH_MISMATCH 200 (OK)
(index):126 GET http://localhost:3000/assets/js/plugins/discourse-reactions_main.Q5vqJe-h8ro1ilp.digested.js net::ERR_CONTENT_LENGTH_MISMATCH 200 (OK)
完全不知道原因。页面也经常加载不出来。通常需要重新加载 2-3 次,还得有点运气才能加载成功。配合 discourse_theme gem 使用时非常令人沮丧,因为更新会触发标签页重新加载,可能导致页面永远处于加载状态。
不过,当页面_确实_加载成功时,这些错误最初并不会出现,但在正常的日志输出之后会出现:
这似乎也与以下问题有关:
与链接中的主题一样,我的环境是在 WSL2 (Ubuntu) 上使用 Dev Containers。
1 个赞
这个问题有进展吗?我每次启动开发环境时仍然会遇到这个问题。页面只显示 Discourse 的加载指示器,没有任何变化;浏览器控制台显示如下:
我尝试了各种软刷新和硬刷新组合,但都无济于事
… 只有在多次刷新并重启开发服务器后,页面才能正常加载。
david
(David Taylor)
3
我找到了这个,里面包含一些提及 Discourse 的回复:
看起来可能已经通过 Prevent truncated responses through managed port-forwarding sockets - Pull Request #338875 - microsoft/vscode - GitHub 修复了,该 PR 几天前已合并。应该已经在 VSCode 的 ‘insiders’ 构建中生效了 
3 个赞