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

Open
opened 2026-02-16 17:43:38 -05:00 by yindo · 3 comments
Owner

Originally created by @asugan on GitHub (Jan 7, 2026).

Originally assigned to: @rekram1-node on GitHub.

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

Originally created by @asugan on GitHub (Jan 7, 2026). Originally assigned to: @rekram1-node on GitHub. ### 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
yindo added the bug label 2026-02-16 17:43:38 -05:00
Author
Owner

@juneleung commented on GitHub (Jan 18, 2026):

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'

@juneleung commented on GitHub (Jan 18, 2026): 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'
Author
Owner

@rekram1-node commented on GitHub (Jan 18, 2026):

try running w/ OPENCODE_DISABLE_DEFAULT_PLUGINS=true

@rekram1-node commented on GitHub (Jan 18, 2026): try running w/ `OPENCODE_DISABLE_DEFAULT_PLUGINS=true`
Author
Owner

@juneleung commented on GitHub (Jan 18, 2026):

try running w/ OPENCODE_DISABLE_DEFAULT_PLUGINS=true

Thanks, it works!

@juneleung commented on GitHub (Jan 18, 2026): > try running w/ `OPENCODE_DISABLE_DEFAULT_PLUGINS=true` Thanks, it works!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4387