Skip to content

.env file causes crash in 1.2.11 #14994

Closed
albertlieyingadrian/opencode
#2

Description

@DonChong2000

Description

What happened?

When ".env" exists and has content, opencode with version 1.2.11 will crash when start. It runs fine in version 1.2.10.

The image demonstrates the minimal repeatable sample:
Image


Here is the full error message.

PS C:\Users\chong\Desktop\test> opencode
============================================================
Bun Canary v1.3.10-canary.100 (6b1d6c76) Windows x64 (baseline)
Windows v.win11_dt
CPU: sse42 avx avx2
Args: "C:\Users\chong\AppData\Roaming\npm\node_modules\opencode-ai\node_modules\opencode-windows-x64\bin\opencode.exe" "--user-agent=opencode/1.2.11" "--use-system-ca" "--"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) fetch(2) jsc standalone_executable workers_spawned 
Builtins: "bun:ffi" "bun:main" "bun:sqlite" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:console" "node:crypto" "node:dns" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:module" "node:net" "node:os" "node:path" "node:process" "node:querystring" "node:readline" "node:stream" "node:stream/promises" "node:string_decoder" "node:timers" "node:timers/promises" "node:tls" "node:tty" "node:url" "node:util" "undici" "node:v8" "node:http2" "node:diagnostics_channel" "node:dgram" 
Elapsed: 535ms | User: 468ms | Sys: 250ms
RSS: 0.59GB | Peak: 0.59GB | Commit: 0.95GB | Faults: 149212 | Machine: 34.06GB

panic(thread 21008): Internal assertion failure: `ThreadLock` is locked by thread 18372, not thread 21008
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:

 https://bun.report/1.3.10/ea26b1d6c7kQugogC+iwgN+xxuK4t2wM8/pM2rmNkxvNm9mQwwn0eCYKERNEL32.DLLut0LCSntdll.dll4gijBA0eNrzzCtJLcpLzFFILC5OLSrJzM9TSEvMzCktSrVSSAjJKEpNTPHJT85OUMgsVsjJT85OTVFIqlQoAUsoGFoYmxvpKOTll8BEjAwNDCwAGpoczw

Plugins

No response

OpenCode version

No response

Steps to reproduce

  1. Use version 1.2.11 (latest)
  2. Create a .env file with content
  3. run opencode

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

VScode powershell terminal, and Windows pershell terminal

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Feb 25, 2026
  2. github-actions commented on Feb 25, 2026

    @github-actions
    Contributor

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

  3. HuynhSang2005 commented on Feb 25, 2026

    @HuynhSang2005

    You can reinstall opencode-ai at version 1.2.10 using Bun

    1. First, uninstall the current package:

      bun uninstall -g opencode-ai
    2. Then, reinstall the package at the specific version you want (in this case, 1.2.10):

      bun install -g [email protected]

    This ensures you’re running the stable version 1.2.10 instead of upgrading to 1.2.11, which may cause errors.

  4. DonChong2000 commented on Feb 25, 2026

    @DonChong2000
    Author

    You can reinstall opencode-ai at version 1.2.10 using Bun

    1. First, uninstall the current package:
      bun uninstall -g opencode-ai
    2. Then, reinstall the package at the specific version you want (in this case, 1.2.10):
      bun install -g [email protected]

    This ensures you’re running the stable version 1.2.10 instead of upgrading to 1.2.11, which may cause errors.

    Thanks for the prompt response!
    I rolled back to 1.2.10 in the image attached, and it's running fine for me.

  5. DonChong2000 commented on Feb 25, 2026

    @DonChong2000
    Author

    For others' reference, we need to temporarily stop the auto-update, or the same error will occur again.

    To do that, edit opencode.json in ~/.config/opencode/opencode.json, and add "autoupdate": false,

    like C:\Users\chong\.config:

    
    {
      "$schema": "https://opencode.ai/config.json",
      "formatter": false,
      "autoupdate": false,
    }
    
    
  6. Hona commented on Feb 26, 2026

    @Hona
    Member

    please upgrade to latest OpenCode v1.2.15 - and try again.

    There should be no more segfaults/crashes.

    Can you confirm it works fine after the version is >v1.2.15 :)

  7. DonChong2000 commented on Feb 26, 2026

    @DonChong2000
    Author

    please upgrade to latest OpenCode v1.2.15 - and try again.

    There should be no more segfaults/crashes.

    Can you confirm it works fine after the version is >v1.2.15 :)

    Yes, it works with opencode 1.2.15 with the .env file.
    Will try to use it normally and see if there is any other problem.

    Really appreciate the fix <3

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 workingcoreAnything pertaining to core functionality of the application (opencode server stuff)windows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions