• 请不要在回答技术问题时复制粘贴 AI 生成的内容
imherer
V2EX  ›  程序员

前后端的大佬们帮忙看看,最近遇到个奇葩问题

  •  3
     
  •   imherer · Feb 19, 2025 · 12361 views
    This topic created in 466 days ago, the information mentioned may be changed or developed.

    有几个数据量比较大( 57kb 左右)的 api 在 chrome 浏览器下偶尔会报错如下:

    GET http://localhost:3000/api/v1/xxx net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK)
    

    这里的 3000 是 vite 的端口,对应的后端端口是 4000 。

    复现场景

    • PC 版 chrome 通过 vite 代理访问后端 api (版本 133.0.6943.99 )

    已尝试过且正常的场景

    • PC chrome 直接访问后端 api 正常
    • PC edge 直接访问后端 api 正常
    • PC edge 通过 vite 代理访问后端 api 正常
    • PC firefox 直接访问后端 api 正常
    • PC firefox 通过 vite 代理访问后端 api 正常
    • Mac chrome 直接访问后端 api 正常
    • Mac chrome 通过 vite 代理访问后端 api 正常
    • PC chrome 访问线上环境 正常
    • 用同事电脑访问 vite 代理 api 也是正常的

    怀疑是不是 chrome 哪里设置不对,但是最近也没改动过设置,我还把 chrome 上所有的扩展都禁用了

    之前没有任何问题,最近也没改动过代码,也没升级过依赖库,发现问题是因为我更新了 GoLand ,然后重启了电脑就出现这个问题了。

    最开始以为是 GoLand 版本导致的,我尝试过不用 GoLand 启动后端程序GoLand 降级为之前版本,问题依旧

    前后端分离的方式,后端是用 Go+Gin,前端是 Vue3+Vite5.2.6 ,本地开发的时候 vite.config.ts 里的 server 配置如下

     proxy: {
            "/api/v1": {
              target: "http://localhost:4000",        
              ws: true,          
              changeOrigin: true,
            },
          }
    
    Supplement 1  ·  Feb 19, 2025
    添加了一个最小的复现仓库,有兴趣的大佬可以试试,看能复现吗

    https://github.com/im-here/err-incomplete-chunked-encoding-reproduction
    102 replies    2025-02-28 09:38:20 +08:00
    1  2  
    avatasia
        101
    avatasia  
       Feb 26, 2025
    今天 chrome 更新,问题解决
    133.0.6943.142
    huiguo19962023
        102
    huiguo19962023  
       Feb 28, 2025
    该问题已经在 Chrome 的 133.0.6943.142 版本中修复了,目前遇到的类似情况在新版本中已被解决
    1  2  
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2933 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 13:14 · PVG 21:14 · LAX 06:14 · JFK 09:14
    ♥ Do have faith in what you're doing.