You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the auto-detection! I checked the related issues but this appears to be a distinct problem:
This is NOT a network/installation race condition - the package @openauthjs/openauth@0.4.3 is successfully downloaded, but its published npm tarball is missing the dist/esm/ directory entirely.
changed the title [-]Windows: auth login fails with 'Cannot find module @openauthjs/openauth/pkce'[/-][+]Windows: OpenCode fails to start - Cannot find module '@openauthjs/openauth/pkce'[/+]on Jan 5, 2026
Activity
github-actions commentedon Jan 5, 2026
This issue might be a duplicate of existing issues. Please check:
Additionally, since this issue involves authentication keybinds and the auth login command, please check our pinned keybinds documentation: #4997
jqbdyhz commentedon Jan 5, 2026
Thanks for the auto-detection! I checked the related issues but this appears to be a distinct problem:
This is NOT a network/installation race condition - the package
@openauthjs/openauth@0.4.3is successfully downloaded, but its published npm tarball is missing thedist/esm/directory entirely.Evidence:
package.jsondeclares:"./*": { "import": "./dist/esm/*.js" }dist/types/andsrc/exist in the installed packagesrc/pkce.tssource file exists, but no compileddist/esm/pkce.jsThis means the upstream package was published without running the build step, so the compiled ESM output is missing.
Workaround confirmed working: manually create
~/.cache/opencode/node_modules/@openauthjs/openauth/dist/esm/pkce.jswith a self-contained PKCE implementation.jqbdyhz commentedon Jan 5, 2026
Update: Issue persists in v1.1.2 (Desktop App & CLI)
Just tested with a fresh install of v1.1.2 (both Desktop App and pnpm-installed CLI) - the issue still occurs.
Why the workaround keeps disappearing
After applying the workaround, OpenCode works fine. But the fix gets lost when:
pkce.js.cache/opencode/node_modules/.cachedirectoriesOne-liner fix (PowerShell)
For anyone hitting this on Windows, here's a quick fix:
Suggested permanent fix
The real fix should happen upstream - either:
@openauthjs/openauthpublishes a version withdist/esm/included🤖 Generated with Claude Code
[-]Windows: auth login fails with 'Cannot find module @openauthjs/openauth/pkce'[/-][+]Windows: OpenCode fails to start - Cannot find module '@openauthjs/openauth/pkce'[/+]ni-caicai commentedon Jan 12, 2026
$d = "$env:USERPROFILE.cache\opencode\node_modules@openauthjs\openauth\dist\esm"; New-Item -ItemType Directory -Force -Path $d | Out-Null; @'
function base64UrlEncode(buffer) { const bytes = new Uint8Array(buffer); let binary = ""; for (let i = 0; i < bytes.byteLength; i++) binary += String.fromCharCode(bytes[i]); return btoa(binary).replace(/+/g, "-").replace(///g, "_").replace(/=+$/, ""); }
export async function generatePKCE() { const verifierBytes = new Uint8Array(32); crypto.getRandomValues(verifierBytes); const verifier = base64UrlEncode(verifierBytes); const encoder = new TextEncoder(); const data = encoder.encode(verifier); const hash = await crypto.subtle.digest("SHA-256", data); const challenge = base64UrlEncode(hash); return { verifier, challenge, method: "S256" }; }
export function createChallenge(verifier) { const encoder = new TextEncoder(); const data = encoder.encode(verifier); return crypto.subtle.digest("SHA-256", data).then(base64UrlEncode); }
'@ | Set-Content "$d\pkce.js" -Encoding UTF8; Write-Host "Fixed!"
Perfect repair,You are so great!
Suggested permanent fix
HWOUq1xd7c commentedon Feb 19, 2026
用everything去清理掉所有和openauth有关的内容,并清空全局npm-cache,卸载opencode并重装,经测试有效
github-actions commentedon Apr 21, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.