[Bug] Windows: Cannot find package 'fast-deep-equal' when running auth login #7727

Closed
opened 2026-02-16 18:08:04 -05:00 by yindo · 2 comments
Owner

Originally created by @MoerAI on GitHub (Jan 27, 2026).

Originally assigned to: @rekram1-node on GitHub.

Bug Description

When running opencode auth login on Windows, the command fails with:

Error: Unexpected error, check log file for more details
ResolveMessage: Cannot find package 'fast-deep-equal' from 'C:\Users\pss\.cache\opencode\node_modules\find-my-way\index.js'

Root Cause

OpenCode uses Bun to install plugins in the cache directory. When @gitlab/opencode-gitlab-auth is loaded (automatically during auth login), it brings in:

@gitlab/opencode-gitlab-auth → fastify → find-my-way → fast-deep-equal

The problem: Bun hoists fast-deep-equal to the root node_modules, but find-my-way uses CommonJS require() which looks for the package in its local node_modules first. Since it's not there, the resolution fails.

Log Analysis

INFO  service=plugin path=@gitlab/opencode-gitlab-auth@1.3.2 loading plugin
INFO  service=bun cmd=["...opencode.exe","add","--force","--exact","--cwd","C:\\Users\\pss\\.cache\\opencode","@gitlab/opencode-gitlab-auth@1.3.2"]
...
ERROR name=ResolveMessage message=Cannot find package 'fast-deep-equal' from '...\find-my-way\index.js' code=MODULE_NOT_FOUND

Environment

  • OS: Windows 11 (win32-x64)
  • OpenCode version: 1.1.36
  • Bun version: 1.3.5 (embedded in opencode)
  • Node version: 24.x

Steps to Reproduce

  1. Install opencode: npm install -g opencode-ai
  2. Run: opencode auth login
  3. Select "Anthropic" as provider
  4. Error occurs

Expected Behavior

opencode auth login should complete successfully without module resolution errors.

Suggested Fix

Option 1: Use npm instead of bun for plugin installation in the cache directory
Option 2: Add fast-deep-equal as an explicit dependency when installing @gitlab/opencode-gitlab-auth
Option 3: Configure bun to preserve nested node_modules for CommonJS packages

Workaround (temporary)

Manually install the missing dependency:

cd ~/.cache/opencode
npm install fast-deep-equal

But this gets overwritten every time opencode runs.

Originally created by @MoerAI on GitHub (Jan 27, 2026). Originally assigned to: @rekram1-node on GitHub. ## Bug Description When running `opencode auth login` on Windows, the command fails with: ``` Error: Unexpected error, check log file for more details ResolveMessage: Cannot find package 'fast-deep-equal' from 'C:\Users\pss\.cache\opencode\node_modules\find-my-way\index.js' ``` ## Root Cause OpenCode uses Bun to install plugins in the cache directory. When `@gitlab/opencode-gitlab-auth` is loaded (automatically during `auth login`), it brings in: ``` @gitlab/opencode-gitlab-auth → fastify → find-my-way → fast-deep-equal ``` **The problem**: Bun hoists `fast-deep-equal` to the root `node_modules`, but `find-my-way` uses CommonJS `require()` which looks for the package in its local `node_modules` first. Since it's not there, the resolution fails. ## Log Analysis ``` INFO service=plugin path=@gitlab/opencode-gitlab-auth@1.3.2 loading plugin INFO service=bun cmd=["...opencode.exe","add","--force","--exact","--cwd","C:\\Users\\pss\\.cache\\opencode","@gitlab/opencode-gitlab-auth@1.3.2"] ... ERROR name=ResolveMessage message=Cannot find package 'fast-deep-equal' from '...\find-my-way\index.js' code=MODULE_NOT_FOUND ``` ## Environment - OS: Windows 11 (win32-x64) - OpenCode version: 1.1.36 - Bun version: 1.3.5 (embedded in opencode) - Node version: 24.x ## Steps to Reproduce 1. Install opencode: `npm install -g opencode-ai` 2. Run: `opencode auth login` 3. Select "Anthropic" as provider 4. Error occurs ## Expected Behavior `opencode auth login` should complete successfully without module resolution errors. ## Suggested Fix Option 1: Use npm instead of bun for plugin installation in the cache directory Option 2: Add `fast-deep-equal` as an explicit dependency when installing `@gitlab/opencode-gitlab-auth` Option 3: Configure bun to preserve nested node_modules for CommonJS packages ## Workaround (temporary) Manually install the missing dependency: ```bash cd ~/.cache/opencode npm install fast-deep-equal ``` But this gets overwritten every time opencode runs.
yindo added the windows label 2026-02-16 18:08:04 -05:00
yindo closed this issue 2026-02-16 18:08:04 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 27, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #9870: Windows: opencode freezes before TUI — missing fast-deep-equal dependency in cached node_modules

Both issues describe the same root cause (Bun hoisting with CommonJS resolution on Windows) and the same error message. The workaround and suggested fixes are identical.

Feel free to ignore if this doesn't match your specific case, but it may help to review that issue's discussion and any solutions that have been implemented.

@github-actions[bot] commented on GitHub (Jan 27, 2026): This issue might be a duplicate of existing issues. Please check: - #9870: Windows: opencode freezes before TUI — missing fast-deep-equal dependency in cached node_modules Both issues describe the same root cause (Bun hoisting with CommonJS resolution on Windows) and the same error message. The workaround and suggested fixes are identical. Feel free to ignore if this doesn't match your specific case, but it may help to review that issue's discussion and any solutions that have been implemented.
Author
Owner

@MoerAI commented on GitHub (Jan 27, 2026):

Closing as duplicate of #9870. See that issue for the fix with --backend=copyfile.

@MoerAI commented on GitHub (Jan 27, 2026): Closing as duplicate of #9870. See that issue for the fix with `--backend=copyfile`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7727