fix(build): disable minify to prevent JSC readonly property errors#26066
Open
stephanschielke wants to merge 1 commit intoanomalyco:devfrom
Open
fix(build): disable minify to prevent JSC readonly property errors#26066stephanschielke wants to merge 1 commit intoanomalyco:devfrom
stephanschielke wants to merge 1 commit intoanomalyco:devfrom
Conversation
Bun --compile --minify causes JSC to freeze mutable fold accumulator objects between iterations, producing "Attempted to assign to readonly property" on Linux x64. Effect maintainer @mikearnaldi confirms this is a Bun minifier bug (Effect-TS/effect-smol#2126). Disabling minify until Bun resolves the underlying JSC object shape optimization issue. Related: anomalyco#25873, oven-sh/bun#13394, oven-sh/bun#12655.
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Potential Related PRs FoundPR #25867 - fix: mutable Stream.runFold crash in compiled binaries, revert effect to beta.57
PR #26067 - fix(deps): revert effect to 4.0.0-beta.57 (pre-regression)
These are related but not duplicates - they represent different approaches to fixing the same underlying problem. PR #26066 (current) disables minify in the build script, while #25867 and #26067 take alternative approaches. |
6 tasks
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #25873
Related: #25835
Type of change
What does this PR do?
Disables
minify: trueinpackages/opencode/script/build.ts.minify: truewas added in PR #22362 (2026-04-14, tested on Windows only) to reduce binary size. Combined witheffect@4.0.0-beta.58+(introduced in v1.14.34 via PR #25524), Bun's JSC freezes mutable fold accumulator objects between iterations in compiled+minified binaries, causingAttempted to assign to readonly propertyon tool calls.v1.14.33 (minify + beta.57) worked because beta.57's fold patterns create new objects each iteration. v1.14.34+ (minify + beta.59) crashes because the mutable accumulators return the same object, which JSC freezes.
Effect maintainer @mikearnaldi confirms: "This is 100% a bug in Bun's minification implementation."
Trade-off: binary size increases ~16% without minification (per PR #22362 measurements). This is acceptable until Bun fixes the underlying JSC object freezing.
Known Bun issues: oven-sh/bun#13394, oven-sh/bun#12655
Related PRs (alternative fixes):
runForEachHow did you verify your code works?
minify: trueis the environmental trigger by testing compiled binaries with and without minificationbun build --compile(no minify) does NOT reproduce the errorbun build --compile --minifyreproduces reliably on Linux x64Screenshots / recordings
N/A (build script change, not a UI change)
Checklist