Skip to content

[Bug] Critical Crash on Linux (Ubuntu): 'jose' dependency corrupted with binary content in buffer_utils.js #7249

Closed

Description

@asugan

Description

Description When attempting to run opencode (e.g., opencode models or installing plugins) on a Linux/Ubuntu environment, the tool crashes immediately. The error points to a syntax error in the jose library, specifically in dist/browser/lib/buffer_utils.js.

Upon inspection, this JavaScript file contains binary/garbage characters instead of valid code, suggesting that the internal package manager/downloader (possibly Bun-based or custom fetcher) is not correctly downloading or extracting this specific dependency.

Error Log

Error: Unexpected error, check log file at ...
1 | G^۝><CCFkCQº2Ha*[8er
^
error: Unexpected
at /home/USER/.cache/opencode/node_modules/jose/dist/browser/lib/buffer_utils.js:1:1

Root Cause Analysis I inspected the file located at ~/.cache/opencode/node_modules/jose/dist/browser/lib/buffer_utils.js. Instead of valid JavaScript, the file starts with binary characters (e.g., G^۝...), which looks like a GZIP artifact or a corrupted binary download that wasn't decoded properly.

Workaround / Fix I was able to resolve this by manually taking over the dependency installation using npm instead of the tool's internal mechanism.

Navigate to the cache directory: cd ~/.cache/opencode

Remove the corrupted modules and lock files: rm -rf node_modules bun.lock

Manually install dependencies using npm: npm install npm install jose@5.9.6 --save (forcing the correct version)

Running opencode models works perfectly after this manual fix.

Note on Persistence: If opencode triggers an internal update or plugin installation, it overwrites node_modules and re-introduces the corrupted binary file, requiring the workaround to be applied again.

System Info

OS: Linux (Ubuntu)

Node Version: Tested on v22.19.0 and v20.19.6 (Issue persists on both)

Opencode Version: Latest

Plugins

No response

OpenCode version

1.1.6

Steps to reproduce

  • Install opencode globally on Ubuntu (npm install -g opencode).
    -Run opencode models (or try to install a plugin).
    -The tool attempts to hydrate the cache/dependencies.
    -Crash occurs.

Screenshot and/or share link

No response

Operating System

Ubuntu 24.04.3 LTS

Terminal

Kitty Terminal

Activity

  1. juneleung commented on Jan 18, 2026

    @juneleung

    same on Arch Linux:

    error: Cannot find module '../../runtime/verify.js' from '/home/juneleung/.cache/opencode/node_modules/jose/dist/browser/jws/flattened/verify.js'

  2. rekram1-node commented on Jan 18, 2026

    @rekram1-node
    Contributor

    try running w/ OPENCODE_DISABLE_DEFAULT_PLUGINS=true

  3. juneleung commented on Jan 19, 2026

    @juneleung

    try running w/ OPENCODE_DISABLE_DEFAULT_PLUGINS=true

    Thanks, it works!

  4. github-actions commented on Mar 27, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions