# 移动设备上的 ERR\_CONTENT\_LENGTH\_MISMATCH

**URL:** https://meta.discourse.org/t/err-content-length-mismatch-on-mobile/184024
**Category:** Development
**Created:** [2021年三月22日 12:11 UTC](https://meta.discourse.org/t/err-content-length-mismatch-on-mobile/184024 "2021-03-22T12:11:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Jaroslaw](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jaroslaw/32/212599_2.png) [@Jaroslaw](https://meta.discourse.org/u/Jaroslaw)
#### Post date: [2021年三月22日 12:11 UTC](https://meta.discourse.org/t/err-content-length-mismatch-on-mobile/184024/1 "2021-03-22T12:11:39Z")

</div>

有人在通过移动设备（模拟器）连接 Discourse 时遇到过 ERR\_CONTENT\_LENGTH\_MISMATCH 错误吗？

我在 Windows 10 机器上安装了 WSL2、Ubuntu 以及 Discourse 论坛。当我通过 Windows 浏览器访问 Discourse 时一切正常，但当我使用移动模拟器访问时，却出现大量 ERR\_CONTENT\_LENGTH\_MISMATCH 错误，论坛无法加载（显示空白页面）。

我通过 IP 地址连接 Discourse，并在 Windows 上配置了端口转发到 WSL2 的 Ubuntu。当我在移动浏览器中访问 [http://192.168.0.6:3000](http://192.168.0.6:3000) 且禁用 JavaScript 时，可以看到论坛内容（但禁用 JavaScript 后功能非常有限）；一旦启用 JavaScript，论坛就完全无法工作了。

开发者控制台的日志如下：

```
GET http://192.168.0.6:3000/assets/locales/en.js?1616414336.2489636 net::ERR_CONTENT_LENGTH_MISMATCH 200 (OK)
GET http://192.168.0.6:3000/assets/pretty-text-bundle.js?1616414336.2663965 net::ERR_CONTENT_LENGTH_MISMATCH 200 (OK)
GET http://192.168.0.6:3000/assets/vendor.js?1616414336.2663667 net::ERR_CONTENT_LENGTH_MISMATCH 200 (OK)
GET http://192.168.0.6:3000/assets/ember_jquery.js?1616414336.2662969 net::ERR_CONTENT_LENGTH_MISMATCH 200 (OK)
GET http://192.168.0.6:3000/assets/plugins/discourse-local-dates.js?1616414336.269725 net::ERR_CONTENT_LENGTH_MISMATCH 200 (OK)
GET http://192.168.0.6:3000/assets/plugins/discourse-presence.js?1616414336.269779 net::ERR_CONTENT_LENGTH_MISMATCH 200 (OK)
GET http://192.168.0.6:3000/assets/plugins/poll.js?1616414336.2698483 net::ERR_CONTENT_LENGTH_MISMATCH 200 (OK)
GET http://192.168.0.6:3000/assets/application.js?1616414336.2664297 net::ERR_CONTENT_LENGTH_MISMATCH 200 (OK)
javascripts/lib/discourse-markdown/details:1 Uncaught ReferenceError: define is not defined
    at eval (javascripts/lib/discourse-markdown/details:1)
    at discourse-details.js?1616414336.2696738:1
(anonymous) @ javascripts/lib/discourse-markdown/details:1
(anonymous) @ discourse-details.js?1616414336.2696738:1
javascripts/initializers/new-user-narrative:1 Uncaught ReferenceError: define is not defined
    at eval (javascripts/initializers/new-user-narrative:1)
    at discourse-narrative-bot.js?1616414336.2697492:1
(anonymous) @ javascripts/initializers/new-user-narrative:1
(anonymous) @ discourse-narrative-bot.js?1616414336.2697492:1
javascripts/initializers/alert:1 Uncaught ReferenceError: define is not defined
    at eval (javascripts/initializers/alert:1)
    at discourse-racoon.js?1616414336.2698188:1
(anonymous) @ javascripts/initializers/alert:1
(anonymous) @ discourse-racoon.js?1616414336.2698188:1
javascripts/lazyYT:174 Uncaught ReferenceError: jQuery is not defined
    at eval (javascripts/lazyYT:174)
    at lazy-yt.js?1616414336.2698355:1
(anonymous) @ javascripts/lazyYT:174
(anonymous) @ lazy-yt.js?1616414336.2698355:1
start-discourse:3 Uncaught ReferenceError: Discourse is not defined
    at eval (start-discourse:3)
    at eval (start-discourse:4)
    at start-discourse.js?1616414336.5657332:1
(anonymous) @ start-discourse:3
(anonymous) @ start-discourse:4
(anonymous) @ start-discourse.js?1616414336.5657332:1
localhost:3000/uploads/default/optimized/1X/_129430568242d1b7f853bb13ebea28b3f6af4e7_2_180x180.png:1 GET http://localhost:3000/uploads/default/optimized/1X/_129430568242d1b7f853bb13ebea28b3f6af4e7_2_180x180.png net::ERR_CONNECTION_REFUSED
localhost:3000/uploads/default/optimized/1X/_129430568242d1b7f853bb13ebea28b3f6af4e7_2_32x32.png:1 GET http://localhost:3000/uploads/default/optimized/1X/_129430568242d1b7f853bb13ebea28b3f6af4e7_2_32x32.png net::ERR_CONNECTION_REFUSED

```
