Skip to content

TypeError: e.diffs.map is not a function when reopening old browser session #19217

Closed

Description

@trafgals

Bug Description

When trying to reopen an old OpenCode web browser window, I get the following JavaScript error:

TypeError: e.diffs.map is not a function
    at Object.fn (http://localhost:4096/assets/session-BdJIdAn0.js:19:50326)
    at H2 (http://localhost:4096/assets/index-Dr5k_2Nz.js:2:6835)
    at $l (http://localhost:4096/assets/index-Dr5k_2Nz.js:2:6592)
    at Df (http://localhost:4096/assets/index-Dr5k_2Nz.js:2:8033)
    at Q7 (http://localhost:4096/assets/index-Dr5k_2Nz.js:2:8914)
    at xO (http://localhost:4096/assets/index-Dr5k_2Nz.js:2:8286)
    at Ir (http://localhost:4096/assets/index-Dr5k_2Nz.js:2:8218)
    at et (http://localhost:4096/assets/index-Dr5k_2Nz.js:2:3989)
    at o (http://localhost:4096/assets/index-Dr5k_2Nz.js:2279:6842)
    at http://localhost:4096/assets/session-BdJIdAn0.js:21:39236

Steps to Reproduce

  1. Open OpenCode web interface
  2. Try to reopen an old browser session/window

Environment

  • OpenCode version: 1.2.27
  • Browser: Happens in Brave, Chrome, Edge
  • OS: Windows 11

Additional Context

The error suggests that e.diffs is not an array (or is undefined) when the map function is called. This may be related to session state corruption or an issue with how session data is being deserialized.

Activity

  1. zhongruan0522 commented on Mar 26, 2026

    @zhongruan0522

    I’ve encountered this issue as well. I’m currently on the latest version (1.3.2), and the error persists even after switching computers or browsers; the only time it stops is when I switch to the mobile version.

  2. lzss433 commented on Mar 26, 2026

    @lzss433

    +1

  3. daShuiLuoBo commented on Mar 26, 2026

    @daShuiLuoBo

    +1

  4. rluisr commented on Mar 26, 2026

    @rluisr

    +1

  5. CyberRookie-X commented on Mar 26, 2026

    @CyberRookie-X

    +1

  6. Kevin589981 commented on Mar 26, 2026

    @Kevin589981

    +1

  7. sllavvicc commented on Mar 26, 2026

    @sllavvicc

    +1

  8. CyberRookie-X commented on Mar 26, 2026

    @CyberRookie-X

    @rekram1-node Can you offer some support for this?

  9. doge-liang commented on Mar 26, 2026

    @doge-liang

    me too

  10. AlexKilianDT commented on Mar 26, 2026

    @AlexKilianDT

    +1

  11. kiko-cn commented on Mar 26, 2026

    @kiko-cn

    +1

  12. OneEyedOlaf commented on Mar 26, 2026

    @OneEyedOlaf

    I have same problem either

  13. glorydreamtop commented on Mar 26, 2026

    @glorydreamtop

    +1

  14. 33 remaining items

  15. xiaomu-software commented on Mar 26, 2026

    @xiaomu-software

    +1,我使用的web端,同样的问题。

    Image
  16. natewill commented on Mar 26, 2026

    @natewill
    Contributor

    The bug should be completely gone whenever a new release is out

  17. scotty86 commented on Mar 26, 2026

    @scotty86

    Close the sidebar through application tab: The bug is caused by review sidebar, so if we close that sidebar it works again.

    1. Open Applications tab in chrome dev console
    2. Under storage, click 'local storage' and then the localhost / port on which opencode runs (e.g. http://127.0.0.1:4096)
    3. Find key 'opencode.global.dat:layout' ,then for value, in the json set panelOpened to false for the review key, so
      "review":{"diffStyle":"split","panelOpened":false}
    4. Reload page

    PS: if you cannot find 'opencode.global.dat:layout'. I think the error page removes it sometimes. Then change another key into it and set it to: {"sidebar":{"opened":false,"width":344,"workspaces":{},"workspacesDefault":false},"terminal":{"height":280,"opened":false},"review":{"diffStyle":"split","panelOpened":true},"fileTree":{"opened":false,"width":200,"tab":"all"},"session":{"width":600},"mobileSidebar":{"opened":false},"sessionTabs":{"session_id_left_out_for_github_share":{"all":[],"active":"review"},"session_id_left_out_for_github_share":{"all":[],"active":"review"}},"sessionView":{},"handoff":{}}

    I noticed the same behavior. If on the left side there is a project shown in the vertical project bar, the error appears.

  18. yetangzhi commented on Mar 26, 2026

    @yetangzhi

    更换更老的版本可以解决嘛?

  19. hdoer commented on Mar 26, 2026

    @hdoer

    更换更老的版本可以解决嘛?

    no

  20. hdoer commented on Mar 26, 2026

    @hdoer

    +1

  21. shuvo-paul commented on Mar 26, 2026

    @shuvo-paul
    Image
  22. Wellinator commented on Mar 26, 2026

    @Wellinator

    +1

  23. thdxr commented on Mar 26, 2026

    @thdxr
    Member

    hey sorry for this. getting fix out now

    the reason we hadn't bundled the webapp into the cli was because we were waiting on our move to node to be complete. we didn't realize many people were using it and the version drift issues are impacting a lot of people

    we're going to figure out bundling today so this doesn't keep happening

  24. thdxr commented on Mar 26, 2026

    @thdxr
    Member

    fixed now - bundling going out in next release

  25. thdxr commented on Mar 26, 2026

    @thdxr
    Member

    Fixed by #19299 - This issue was caused by version drift between the web UI assets served from the CDN and the local server. Version 1.3.3 is going out now and embeds the WebUI directly in the binary, eliminating any version drift between the server and web UI.

  26. thdxr commented on Mar 26, 2026

    @thdxr
    Member

    Closing as fixed by #19299

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

webRelates to opencode on web / desktop

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions